src/Container.php
private function getInjector(\ReflectionClass $reflection): InjectorInterface
    {
        if (isset($this->injectors[$reflection->getName()])) {
            //Stated directly
            $injector = $this->get($this->injectors[$reflection->getName()]);
        } else {
            //Auto-injection!
            $injector = $this->get($reflection->getConstant('INJECTOR'));
        }

        if (!$injector instanceof InjectorInterface) {
            throw new InjectionException(sprintf(
                "Class '%s' must be an instance of InjectorInterface for '%s'",
                get_class($injector),
                $reflection->getName()
            ));
        }

        return $injector;
    }
private function getInjector(\ReflectionClass $reflection): InjectorInterface
    {
        if (isset($this->injectors[$reflection->getName()])) {
            //Stated directly
            $injector = $this->get($this->injectors[$reflection->getName()]);
        } else {
            //Auto-injection!
            $injector = $this->get($reflection->getConstant('INJECTOR'));
        }

        if (!$injector instanceof InjectorInterface) {
            throw new InjectionException(sprintf(
                "Class '%s' must be an instance of InjectorInterface for '%s'",
                get_class($injector),
                $reflection->getName()
            ));
        }

        return $injector;
    }
private function getInjector ( \ ReflectionClass $ reflection ) : InjectorInterface { if ( isset ( $ this -> injectors [ $ reflection -> getName ( ) ] ) ) { //Stated directly $ injector = $ this -> get ( $ this -> injectors [ $ reflection -> getName ( ) ] ) ; } else { //Auto-injection! $ injector = $ this -> get ( $ reflection -> getConstant ( 'INJECTOR' ) ) ; } if ( ! $ injector instanceof InjectorInterface ) { throw new InjectionException ( sprintf ( "Class '%s' must be an instance of InjectorInterface for '%s'" , get_class ( $ injector ) , $ reflection -> getName ( ) ) ) ; } return $ injector ; }
Get injector associated with given class.

@param \ReflectionClass $reflection
@return InjectorInterface
Get injector associated with given class .