original_string: public function listAction()
      {
          $repository = $this->get('phlexible_media_template.template_manager');
  
          $allTemplates = $repository->findAll();
  
          $templates = [];
          foreach ($allTemplates as $template) {
              if (substr($template->getKey(), 0, 4) === '_mm_') {
                  continue;
              }
  
              $templates[] = [
                  'key' => $template->getKey(),
                  'type' => $template->getType(),
              ];
          }
  
          return new JsonResponse(['templates' => $templates]);
      }
code: public function listAction()
      {
          $repository = $this->get('phlexible_media_template.template_manager');
  
          $allTemplates = $repository->findAll();
  
          $templates = [];
          foreach ($allTemplates as $template) {
              if (substr($template->getKey(), 0, 4) === '_mm_') {
                  continue;
              }
  
              $templates[] = [
                  'key' => $template->getKey(),
                  'type' => $template->getType(),
              ];
          }
  
          return new JsonResponse(['templates' => $templates]);
      }
code_tokens: public function listAction ( ) { $ repository = $ this -> get ( 'phlexible_media_template.template_manager' ) ; $ allTemplates = $ repository -> findAll ( ) ; $ templates = [ ] ; foreach ( $ allTemplates as $ template ) { if ( substr ( $ template -> getKey ( ) , 0 , 4 ) === '_mm_' ) { continue ; } $ templates [ ] = [ 'key' => $ template -> getKey ( ) , 'type' => $ template -> getType ( ) , ] ; } return new JsonResponse ( [ 'templates' => $ templates ] ) ; }
docstring: List mediatemplates.
  
  @return JsonResponse
  @Route("/list", name="mediatemplates_templates_list")
docstring_tokens: List mediatemplates .