src/Core/DependencyInjector/DependencyInjector.php
public function getDiRequirements($className)
    {
        if (!isset($this->classCache[$className])) {
            $reflectionClass = new \ReflectionClass($className);
            $injects = [];
            // get all defined properties
            $props = $reflectionClass->getProperties();
            foreach ($props as $prop) {
                $inject = $this->annotationReader->getPropertyAnnotation(
                    $prop,
                    'Slender\Core\DependencyInjector\Annotation\Inject'
                );
                if ($inject) {

                    // Get the DI identifier
                    $identifier = $inject->getIdentifier();
                    if (!$identifier) {
                        $identifier = Util::hyphenCase($prop->getName());
                    }

                    $data = array(
                        'identifier' => $identifier,
                        'isPublic' => $prop->isPublic(),
                        'setter' => false
                    );

                    // Is there a setter method (cos its still faster andrew...)
                    if (!$prop->isPublic()) {
                        $setter = Util::setterMethodName($prop->getName());
                        if (method_exists($className, $setter)) {
                            $data['hasSetter'] = $setter;
                        };
                    };

                    $injects[$prop->getName()] = $data;
                }
            }
            $this->classCache[$className] = $injects;
        }
        return $this->classCache[$className];
    }
public function getDiRequirements($className)
    {
        if (!isset($this->classCache[$className])) {
            $reflectionClass = new \ReflectionClass($className);
            $injects = [];
            // get all defined properties
            $props = $reflectionClass->getProperties();
            foreach ($props as $prop) {
                $inject = $this->annotationReader->getPropertyAnnotation(
                    $prop,
                    'Slender\Core\DependencyInjector\Annotation\Inject'
                );
                if ($inject) {

                    // Get the DI identifier
                    $identifier = $inject->getIdentifier();
                    if (!$identifier) {
                        $identifier = Util::hyphenCase($prop->getName());
                    }

                    $data = array(
                        'identifier' => $identifier,
                        'isPublic' => $prop->isPublic(),
                        'setter' => false
                    );

                    // Is there a setter method (cos its still faster andrew...)
                    if (!$prop->isPublic()) {
                        $setter = Util::setterMethodName($prop->getName());
                        if (method_exists($className, $setter)) {
                            $data['hasSetter'] = $setter;
                        };
                    };

                    $injects[$prop->getName()] = $data;
                }
            }
            $this->classCache[$className] = $injects;
        }
        return $this->classCache[$className];
    }
public function getDiRequirements ( $ className ) { if ( ! isset ( $ this -> classCache [ $ className ] ) ) { $ reflectionClass = new \ ReflectionClass ( $ className ) ; $ injects = [ ] ; // get all defined properties $ props = $ reflectionClass -> getProperties ( ) ; foreach ( $ props as $ prop ) { $ inject = $ this -> annotationReader -> getPropertyAnnotation ( $ prop , 'Slender\Core\DependencyInjector\Annotation\Inject' ) ; if ( $ inject ) { // Get the DI identifier $ identifier = $ inject -> getIdentifier ( ) ; if ( ! $ identifier ) { $ identifier = Util :: hyphenCase ( $ prop -> getName ( ) ) ; } $ data = array ( 'identifier' => $ identifier , 'isPublic' => $ prop -> isPublic ( ) , 'setter' => false ) ; // Is there a setter method (cos its still faster andrew...) if ( ! $ prop -> isPublic ( ) ) { $ setter = Util :: setterMethodName ( $ prop -> getName ( ) ) ; if ( method_exists ( $ className , $ setter ) ) { $ data [ 'hasSetter' ] = $ setter ; } ; } ; $ injects [ $ prop -> getName ( ) ] = $ data ; } } $ this -> classCache [ $ className ] = $ injects ; } return $ this -> classCache [ $ className ] ; }
Interrogate a class and see what dependencies
it wants to be passed into its constructor

@param string $className Name of class to inspece
@return array of DI container identifiers
Interrogate a class and see what dependencies it wants to be passed into its constructor