Example #1
0
 /**
  * @param mixed $injected
  * @param string $resourceKey
  *
  * @return $this
  */
 function with($injected, $resourceKey = null)
 {
     if (is_object($injected)) {
         $this->injectionRegistry->registerClassResource($injected, $resourceKey);
     } elseif ($resourceKey !== null) {
         $this->injectionRegistry->registerPrimitiveResource($resourceKey, $injected);
     }
     return $this;
 }
Example #2
0
 /**
  * @param string $resourceKey
  * @param mixed $value
  *
  * @return $this
  */
 function registerPrimitiveResource($resourceKey, $value)
 {
     $this->resourceRegistry->registerPrimitiveResource($resourceKey, $value);
     return $this;
 }