private function getExpandedRoles(array $roleScopes)
    {
        $expandedRoles = array();
        foreach ($roleScopes as $roleScope) {
            if (!array_key_exists($roleScope->getRole(), $expandedRoles)) {
                $expandedRoles[$roleScope->getRole()] = 
                      array_map(
                            function(RoleInterface $role) {
                          
                                return $role->getRole();
                            },
                            $this->get('security.role_hierarchy')
                                ->getReachableRoles(
                                      array(new Role($roleScope->getRole()))
                                    )
                        );
            }
        }
        return $expandedRoles;
    }
private function getExpandedRoles(array $roleScopes)
    {
        $expandedRoles = array();
        foreach ($roleScopes as $roleScope) {
            if (!array_key_exists($roleScope->getRole(), $expandedRoles)) {
                $expandedRoles[$roleScope->getRole()] = 
                      array_map(
                            function(RoleInterface $role) {
                          
                                return $role->getRole();
                            },
                            $this->get('security.role_hierarchy')
                                ->getReachableRoles(
                                      array(new Role($roleScope->getRole()))
                                    )
                        );
            }
        }
        return $expandedRoles;
    }
private function getExpandedRoles ( array $ roleScopes ) { $ expandedRoles = array ( ) ; foreach ( $ roleScopes as $ roleScope ) { if ( ! array_key_exists ( $ roleScope -> getRole ( ) , $ expandedRoles ) ) { $ expandedRoles [ $ roleScope -> getRole ( ) ] = array_map ( function ( RoleInterface $ role ) { return $ role -> getRole ( ) ; } , $ this -> get ( 'security.role_hierarchy' ) -> getReachableRoles ( array ( new Role ( $ roleScope -> getRole ( ) ) ) ) ) ; } } return $ expandedRoles ; }
expand roleScopes to be easily shown in template

@param array $roleScopes
@return array
expand roleScopes to be easily shown in template