Exemple #1
0
 public function getValue(ParameterInjectorInterface $injector)
 {
     $isConstructable = class_exists($this->type) || interface_exists($this->type);
     if ($isConstructable === true) {
         return $injector->construct($this->containerIndex, $this->type);
     } else {
         return $injector->get($this->containerIndex);
     }
 }
Exemple #2
0
 public function getValue(ParameterInjectorInterface $injector)
 {
     $closure = $this->closure;
     $parameters = $injector->determineParameterValues(new \ReflectionFunction($closure));
     return $closure(...$parameters);
 }