original_string: public function getNames(Profile $profile)
      {
          $templates = [];
  
          foreach ($this->templates as $arguments) {
              if (null === $arguments) {
                  continue;
              }
  
              list($name, $template) = $arguments;
  
              if (!$this->profiler->has($name) || !$profile->hasCollector($name)) {
                  continue;
              }
  
              if ('.html.twig' === substr($template, -10)) {
                  $template = substr($template, 0, -10);
              }
  
              if (!$this->templateExists($template.'.html.twig')) {
                  throw new \UnexpectedValueException(sprintf('The profiler template "%s.html.twig" for data collector "%s" does not exist.', $template, $name));
              }
  
              $templates[$name] = $template.'.html.twig';
          }
  
          return $templates;
      }
code: public function getNames(Profile $profile)
      {
          $templates = [];
  
          foreach ($this->templates as $arguments) {
              if (null === $arguments) {
                  continue;
              }
  
              list($name, $template) = $arguments;
  
              if (!$this->profiler->has($name) || !$profile->hasCollector($name)) {
                  continue;
              }
  
              if ('.html.twig' === substr($template, -10)) {
                  $template = substr($template, 0, -10);
              }
  
              if (!$this->templateExists($template.'.html.twig')) {
                  throw new \UnexpectedValueException(sprintf('The profiler template "%s.html.twig" for data collector "%s" does not exist.', $template, $name));
              }
  
              $templates[$name] = $template.'.html.twig';
          }
  
          return $templates;
      }
code_tokens: public function getNames ( Profile $ profile ) { $ templates = [ ] ; foreach ( $ this -> templates as $ arguments ) { if ( null === $ arguments ) { continue ; } list ( $ name , $ template ) = $ arguments ; if ( ! $ this -> profiler -> has ( $ name ) || ! $ profile -> hasCollector ( $ name ) ) { continue ; } if ( '.html.twig' === substr ( $ template , - 10 ) ) { $ template = substr ( $ template , 0 , - 10 ) ; } if ( ! $ this -> templateExists ( $ template . '.html.twig' ) ) { throw new \ UnexpectedValueException ( sprintf ( 'The profiler template "%s.html.twig" for data collector "%s" does not exist.' , $ template , $ name ) ) ; } $ templates [ $ name ] = $ template . '.html.twig' ; } return $ templates ; }
docstring: Gets template names of templates that are present in the viewed profile.
  
  @return array
  
  @throws \UnexpectedValueException
docstring_tokens: Gets template names of templates that are present in the viewed profile .