protected function expandProperties($className)
    {
        $class = $this->classDefinitions[$className];

        $newProperties = [];

        foreach (array_merge($class['implements'], $class['extends']) as $extends) {
            if (!isset($this->classDefinitions[$extends])) {
                continue;
            }

            foreach ($this->classDefinitions[$extends]['properties'] as $propertyName => $propertyInfo) {
                if ($propertyInfo['visibility'] === 'private') {
                    continue;
                }

                if (!isset($class[$propertyName])) {
                    $newProperties[$propertyName] = $propertyInfo;
                }
            }

            $newProperties = array_merge($newProperties, $this->expandProperties($extends));
        }

        $this->classDefinitions[$className]['properties'] += $newProperties;

        return $newProperties;
    }
protected function expandProperties($className)
    {
        $class = $this->classDefinitions[$className];

        $newProperties = [];

        foreach (array_merge($class['implements'], $class['extends']) as $extends) {
            if (!isset($this->classDefinitions[$extends])) {
                continue;
            }

            foreach ($this->classDefinitions[$extends]['properties'] as $propertyName => $propertyInfo) {
                if ($propertyInfo['visibility'] === 'private') {
                    continue;
                }

                if (!isset($class[$propertyName])) {
                    $newProperties[$propertyName] = $propertyInfo;
                }
            }

            $newProperties = array_merge($newProperties, $this->expandProperties($extends));
        }

        $this->classDefinitions[$className]['properties'] += $newProperties;

        return $newProperties;
    }
protected function expandProperties ( $ className ) { $ class = $ this -> classDefinitions [ $ className ] ; $ newProperties = [ ] ; foreach ( array_merge ( $ class [ 'implements' ] , $ class [ 'extends' ] ) as $ extends ) { if ( ! isset ( $ this -> classDefinitions [ $ extends ] ) ) { continue ; } foreach ( $ this -> classDefinitions [ $ extends ] [ 'properties' ] as $ propertyName => $ propertyInfo ) { if ( $ propertyInfo [ 'visibility' ] === 'private' ) { continue ; } if ( ! isset ( $ class [ $ propertyName ] ) ) { $ newProperties [ $ propertyName ] = $ propertyInfo ; } } $ newProperties = array_merge ( $ newProperties , $ this -> expandProperties ( $ extends ) ) ; } $ this -> classDefinitions [ $ className ] [ 'properties' ] += $ newProperties ; return $ newProperties ; }
This method goes through all the class definitions, and adds non-overridden property
information from parent classes.

@param string $className

@return array
This method goes through all the class definitions and adds non - overridden property information from parent classes .