protected function flattenRoles(array $roles)
    {
        $roleNames = [];
        $iterator  = $this->traversalStrategy->getRolesIterator($roles);

        foreach ($iterator as $role) {
            $roleNames[] = $role->getName();
        }

        return array_unique($roleNames);
    }
protected function flattenRoles(array $roles)
    {
        $roleNames = [];
        $iterator  = $this->traversalStrategy->getRolesIterator($roles);

        foreach ($iterator as $role) {
            $roleNames[] = $role->getName();
        }

        return array_unique($roleNames);
    }
protected function flattenRoles ( array $ roles ) { $ roleNames = [ ] ; $ iterator = $ this -> traversalStrategy -> getRolesIterator ( $ roles ) ; foreach ( $ iterator as $ role ) { $ roleNames [ ] = $ role -> getName ( ) ; } return array_unique ( $ roleNames ) ; }
Flatten an array of role with role names

This method iterates through the list of roles, and convert any RoleInterface to a string. For any
role, it also extracts all the children

@param  array|RoleInterface[] $roles
@return string[]
Flatten an array of role with role names