public function getDescendants()
    {
        $descendants = [];
        if ($this->hasChildren()) {
            foreach ($this->getChildren() as $child) {
                $childDescendants = $child->hasChildren() ? $child->getDescendants() : [];
                $descendants = ArrayUtils::merge($descendants, ArrayUtils::merge([$child], $childDescendants));
            }
        }
        return $descendants;
    }
public function getDescendants()
    {
        $descendants = [];
        if ($this->hasChildren()) {
            foreach ($this->getChildren() as $child) {
                $childDescendants = $child->hasChildren() ? $child->getDescendants() : [];
                $descendants = ArrayUtils::merge($descendants, ArrayUtils::merge([$child], $childDescendants));
            }
        }
        return $descendants;
    }
public function getDescendants ( ) { $ descendants = [ ] ; if ( $ this -> hasChildren ( ) ) { foreach ( $ this -> getChildren ( ) as $ child ) { $ childDescendants = $ child -> hasChildren ( ) ? $ child -> getDescendants ( ) : [ ] ; $ descendants = ArrayUtils :: merge ( $ descendants , ArrayUtils :: merge ( [ $ child ] , $ childDescendants ) ) ; } } return $ descendants ; }
Get all descendants.

@return EnvironmentInterface[]
Get all descendants .