protected function getSubElements(DescriptorAbstract $element): array
    {
        $subElements = [];

        if ($element instanceof ClassInterface) {
            $subElements = array_merge(
                $element->getMethods()->getAll(),
                $element->getConstants()->getAll(),
                $element->getProperties()->getAll()
            );
        }

        if ($element instanceof InterfaceInterface) {
            $subElements = array_merge(
                $element->getMethods()->getAll(),
                $element->getConstants()->getAll()
            );
        }

        if ($element instanceof TraitInterface) {
            $subElements = array_merge(
                $element->getMethods()->getAll(),
                $element->getProperties()->getAll()
            );
        }

        return $subElements;
    }
protected function getSubElements(DescriptorAbstract $element): array
    {
        $subElements = [];

        if ($element instanceof ClassInterface) {
            $subElements = array_merge(
                $element->getMethods()->getAll(),
                $element->getConstants()->getAll(),
                $element->getProperties()->getAll()
            );
        }

        if ($element instanceof InterfaceInterface) {
            $subElements = array_merge(
                $element->getMethods()->getAll(),
                $element->getConstants()->getAll()
            );
        }

        if ($element instanceof TraitInterface) {
            $subElements = array_merge(
                $element->getMethods()->getAll(),
                $element->getProperties()->getAll()
            );
        }

        return $subElements;
    }
protected function getSubElements ( DescriptorAbstract $ element ) : array { $ subElements = [ ] ; if ( $ element instanceof ClassInterface ) { $ subElements = array_merge ( $ element -> getMethods ( ) -> getAll ( ) , $ element -> getConstants ( ) -> getAll ( ) , $ element -> getProperties ( ) -> getAll ( ) ) ; } if ( $ element instanceof InterfaceInterface ) { $ subElements = array_merge ( $ element -> getMethods ( ) -> getAll ( ) , $ element -> getConstants ( ) -> getAll ( ) ) ; } if ( $ element instanceof TraitInterface ) { $ subElements = array_merge ( $ element -> getMethods ( ) -> getAll ( ) , $ element -> getProperties ( ) -> getAll ( ) ) ; } return $ subElements ; }
Returns any sub-elements for the given element.

This method checks whether the given element is a class, interface or trait and returns
their methods, properties and constants accordingly, or an empty array if no sub-elements
are applicable.

@return DescriptorAbstract[]
Returns any sub - elements for the given element .