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); } }
public function getValue(ParameterInjectorInterface $injector) { $closure = $this->closure; $parameters = $injector->determineParameterValues(new \ReflectionFunction($closure)); return $closure(...$parameters); }