src/Security/Permission.php
protected static function traverse_declared_permissions($declared, &$list)
    {
        if (!is_array($declared)) {
            return;
        }

        foreach ($declared as $perm => $value) {
            if ($value instanceof Permission_Group) {
                $list[] = $value->getName();
                self::traverse_declared_permissions($value->getPermissions(), $list);
            } else {
                $list[$perm] = $value;
            }
        }
    }
protected static function traverse_declared_permissions($declared, &$list)
    {
        if (!is_array($declared)) {
            return;
        }

        foreach ($declared as $perm => $value) {
            if ($value instanceof Permission_Group) {
                $list[] = $value->getName();
                self::traverse_declared_permissions($value->getPermissions(), $list);
            } else {
                $list[$perm] = $value;
            }
        }
    }
protected static function traverse_declared_permissions ( $ declared , & $ list ) { if ( ! is_array ( $ declared ) ) { return ; } foreach ( $ declared as $ perm => $ value ) { if ( $ value instanceof Permission_Group ) { $ list [ ] = $ value -> getName ( ) ; self :: traverse_declared_permissions ( $ value -> getPermissions ( ) , $ list ) ; } else { $ list [ $ perm ] = $ value ; } } }
Recursively traverse the nested list of declared permissions and create
a linear list.

@param array $declared Nested structure of permissions.
@param array $list List of permissions in the structure. The result will be
written to this array.
@deprecated 4.4.0
Recursively traverse the nested list of declared permissions and create a linear list .