original_string: public function listAction()
      {
          $roleHierarchy = $this->container->getParameter('security.role_hierarchy.roles');
  
          $roles = [];
          foreach (array_keys($roleHierarchy) as $role) {
              $roles[] = ['id' => $role, 'name' => $role];
          }
  
          return new JsonResponse($roles);
      }
code: public function listAction()
      {
          $roleHierarchy = $this->container->getParameter('security.role_hierarchy.roles');
  
          $roles = [];
          foreach (array_keys($roleHierarchy) as $role) {
              $roles[] = ['id' => $role, 'name' => $role];
          }
  
          return new JsonResponse($roles);
      }
code_tokens: public function listAction ( ) { $ roleHierarchy = $ this -> container -> getParameter ( 'security.role_hierarchy.roles' ) ; $ roles = [ ] ; foreach ( array_keys ( $ roleHierarchy ) as $ role ) { $ roles [ ] = [ 'id' => $ role , 'name' => $ role ] ; } return new JsonResponse ( $ roles ) ; }
docstring: List roles.
  
  @return JsonResponse
  @Route("", name="users_roles_list")
  @Method("GET")
  @ApiDoc(
  description="Returns a list of roles"
  )
docstring_tokens: List roles .