private function canInject(array $classArray, $className = null) {
        $className = ($className === null) ? $this->getClass() : $className;

        if (!self::addInjecting($className)) {
            return false;
        }

        $refClass = new \ReflectionClass($classArray['class']);

        if ($refClass->isSubclassOf('DScribe\Core\AInjector')) {
            $class = new $classArray['class']();

            if (!$class->checkInjections($className))
                return false;
        }
        self::removeInjecting($className);

        return (isset($classArray['params']) && $refClass->getConstructor()) ?
                $refClass->newInstanceArgs($classArray['params']) :
                $refClass->newInstance();
    }
private function canInject(array $classArray, $className = null) {
        $className = ($className === null) ? $this->getClass() : $className;

        if (!self::addInjecting($className)) {
            return false;
        }

        $refClass = new \ReflectionClass($classArray['class']);

        if ($refClass->isSubclassOf('DScribe\Core\AInjector')) {
            $class = new $classArray['class']();

            if (!$class->checkInjections($className))
                return false;
        }
        self::removeInjecting($className);

        return (isset($classArray['params']) && $refClass->getConstructor()) ?
                $refClass->newInstanceArgs($classArray['params']) :
                $refClass->newInstance();
    }
private function canInject ( array $ classArray , $ className = null ) { $ className = ( $ className === null ) ? $ this -> getClass ( ) : $ className ; if ( ! self :: addInjecting ( $ className ) ) { return false ; } $ refClass = new \ ReflectionClass ( $ classArray [ 'class' ] ) ; if ( $ refClass -> isSubclassOf ( 'DScribe\Core\AInjector' ) ) { $ class = new $ classArray [ 'class' ] ( ) ; if ( ! $ class -> checkInjections ( $ className ) ) return false ; } self :: removeInjecting ( $ className ) ; return ( isset ( $ classArray [ 'params' ] ) && $ refClass -> getConstructor ( ) ) ? $ refClass -> newInstanceArgs ( $ classArray [ 'params' ] ) : $ refClass -> newInstance ( ) ; }
Checks if the class can be injected
@param array $classArray
@param string|null $className
@return boolean
Checks if the class can be injected