original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: expand roleScopes to be easily shown in template
  
  @param array $roleScopes
  @return array
docstring_tokens: expand roleScopes to be easily shown in template