private static function extractEntityDescriptors(EntitiesDescriptor $entity)
    {
        $results = [];
        foreach ($entity->children as $child) {
            if ($child instanceof EntityDescriptor) {
                $results[] = $child;
                continue;
            }

            $results = array_merge($results, self::extractEntityDescriptors($child));
        }
        return $results;
    }
private static function extractEntityDescriptors(EntitiesDescriptor $entity)
    {
        $results = [];
        foreach ($entity->children as $child) {
            if ($child instanceof EntityDescriptor) {
                $results[] = $child;
                continue;
            }

            $results = array_merge($results, self::extractEntityDescriptors($child));
        }
        return $results;
    }
private static function extractEntityDescriptors ( EntitiesDescriptor $ entity ) { $ results = [ ] ; foreach ( $ entity -> children as $ child ) { if ( $ child instanceof EntityDescriptor ) { $ results [ ] = $ child ; continue ; } $ results = array_merge ( $ results , self :: extractEntityDescriptors ( $ child ) ) ; } return $ results ; }
Recursively browse the children of an EntitiesDescriptor element looking for EntityDescriptor elements, and
return an array containing all of them.

@param \SAML2\XML\md\EntitiesDescriptor $entity The source EntitiesDescriptor that holds the entities to extract.

@return array An array containing all the EntityDescriptors found.
Recursively browse the children of an EntitiesDescriptor element looking for EntityDescriptor elements and return an array containing all of them .