public function load(ReflectionClass $class)
    {
        $this->reset();

        $this->reflectionClass = $class;
        $this->name            = $this->reflectionClass->getName();

        if (!$this->reflectionClass->isInstantiable()) {
            return $this;
        }

        $this->interfaces            = $this->resolveInterfaces();
        $this->parent                = $this->resolveParent();
        $this->reflectionConstructor = $this->reflectionClass->getConstructor();

        if (is_null($this->reflectionConstructor)) {
            return $this;
        }

        $params = $this->reflectionConstructor->getParameters();

        if (empty($params)) {
            return $this;
        }

        /** @var $param \ReflectionParameter */
        foreach ($params as $param) {
            $paramName                = $param->getName();
            $this->params[$paramName] = $this->resolveArgumentValue($param);
            $this->paramNames[]       = $paramName;
        }

        $this->constructorParams = $params;

        return $this;
    }
public function load(ReflectionClass $class)
    {
        $this->reset();

        $this->reflectionClass = $class;
        $this->name            = $this->reflectionClass->getName();

        if (!$this->reflectionClass->isInstantiable()) {
            return $this;
        }

        $this->interfaces            = $this->resolveInterfaces();
        $this->parent                = $this->resolveParent();
        $this->reflectionConstructor = $this->reflectionClass->getConstructor();

        if (is_null($this->reflectionConstructor)) {
            return $this;
        }

        $params = $this->reflectionConstructor->getParameters();

        if (empty($params)) {
            return $this;
        }

        /** @var $param \ReflectionParameter */
        foreach ($params as $param) {
            $paramName                = $param->getName();
            $this->params[$paramName] = $this->resolveArgumentValue($param);
            $this->paramNames[]       = $paramName;
        }

        $this->constructorParams = $params;

        return $this;
    }
public function load ( ReflectionClass $ class ) { $ this -> reset ( ) ; $ this -> reflectionClass = $ class ; $ this -> name = $ this -> reflectionClass -> getName ( ) ; if ( ! $ this -> reflectionClass -> isInstantiable ( ) ) { return $ this ; } $ this -> interfaces = $ this -> resolveInterfaces ( ) ; $ this -> parent = $ this -> resolveParent ( ) ; $ this -> reflectionConstructor = $ this -> reflectionClass -> getConstructor ( ) ; if ( is_null ( $ this -> reflectionConstructor ) ) { return $ this ; } $ params = $ this -> reflectionConstructor -> getParameters ( ) ; if ( empty ( $ params ) ) { return $ this ; } /** @var $param \ReflectionParameter */ foreach ( $ params as $ param ) { $ paramName = $ param -> getName ( ) ; $ this -> params [ $ paramName ] = $ this -> resolveArgumentValue ( $ param ) ; $ this -> paramNames [ ] = $ paramName ; } $ this -> constructorParams = $ params ; return $ this ; }
Load a class using its ReflectionClass object.

@param ReflectionClass $class

@throws \Exception|\ReflectionException
@return Descriptor
Load a class using its ReflectionClass object .