src/Jest/Injector.php
public function invoke(Callable $callable)
	{
		$reflection = $this->reflectCallable($callable);

		$args = [];

		foreach($reflection->getParameters() as $param) {
			$type = $param->getClass()->getName();

			if (in_array($type, $this->resolving)) {
				throw new \LogicException("Recursive dependency: $type is currently instatiating.");
			}

			$args[] = ($param->allowsNull() && !isset($this[$type])) ? null : $this[$type];
		}

		return call_user_func_array($callable, $args);
	}
public function invoke(Callable $callable)
	{
		$reflection = $this->reflectCallable($callable);

		$args = [];

		foreach($reflection->getParameters() as $param) {
			$type = $param->getClass()->getName();

			if (in_array($type, $this->resolving)) {
				throw new \LogicException("Recursive dependency: $type is currently instatiating.");
			}

			$args[] = ($param->allowsNull() && !isset($this[$type])) ? null : $this[$type];
		}

		return call_user_func_array($callable, $args);
	}
public function invoke ( Callable $ callable ) { $ reflection = $ this -> reflectCallable ( $ callable ) ; $ args = [ ] ; foreach ( $ reflection -> getParameters ( ) as $ param ) { $ type = $ param -> getClass ( ) -> getName ( ) ; if ( in_array ( $ type , $ this -> resolving ) ) { throw new \ LogicException ( "Recursive dependency: $type is currently instatiating." ) ; } $ args [ ] = ( $ param -> allowsNull ( ) && ! isset ( $ this [ $ type ] ) ) ? null : $ this [ $ type ] ; } return call_user_func_array ( $ callable , $ args ) ; }
Invoke a callable and injects dependencies

@param $callable mixed
The Closure or object to inject dependencies into

@return mixed
The value return from the callable
Invoke a callable and injects dependencies