original_string: public function visitFilter(FilterInterface $filter)
      {
          if ($filter instanceof DummyFilter) {
              $type = 'dummy';
          } elseif ($filter instanceof SelectFilter) {
              $type = 'select';
          } elseif ($filter instanceof SearchFilter) {
              $type = 'search';
          } elseif ($filter instanceof SortFilter) {
              $type = 'sort';
          } elseif ($filter instanceof PaginationFilter) {
              $type = "{$filter->getType()}-pagination";
          } elseif (method_exists($filter, 'getType') === true) {
              $type = $filter->getType();
          } else {
              $type = 'dummy';
          }
          $template = "filter/$type.twig";
  
          return $this
              ->loadTemplate($template)
              ->render(
                  [
                      "id" => $filter->getId(),
                      "options" => $filter->getOptions(),
                  ]
              );
      }
code: public function visitFilter(FilterInterface $filter)
      {
          if ($filter instanceof DummyFilter) {
              $type = 'dummy';
          } elseif ($filter instanceof SelectFilter) {
              $type = 'select';
          } elseif ($filter instanceof SearchFilter) {
              $type = 'search';
          } elseif ($filter instanceof SortFilter) {
              $type = 'sort';
          } elseif ($filter instanceof PaginationFilter) {
              $type = "{$filter->getType()}-pagination";
          } elseif (method_exists($filter, 'getType') === true) {
              $type = $filter->getType();
          } else {
              $type = 'dummy';
          }
          $template = "filter/$type.twig";
  
          return $this
              ->loadTemplate($template)
              ->render(
                  [
                      "id" => $filter->getId(),
                      "options" => $filter->getOptions(),
                  ]
              );
      }
code_tokens: public function visitFilter ( FilterInterface $ filter ) { if ( $ filter instanceof DummyFilter ) { $ type = 'dummy' ; } elseif ( $ filter instanceof SelectFilter ) { $ type = 'select' ; } elseif ( $ filter instanceof SearchFilter ) { $ type = 'search' ; } elseif ( $ filter instanceof SortFilter ) { $ type = 'sort' ; } elseif ( $ filter instanceof PaginationFilter ) { $ type = "{$filter->getType()}-pagination" ; } elseif ( method_exists ( $ filter , 'getType' ) === true ) { $ type = $ filter -> getType ( ) ; } else { $ type = 'dummy' ; } $ template = "filter/$type.twig" ; return $ this -> loadTemplate ( $ template ) -> render ( [ "id" => $ filter -> getId ( ) , "options" => $ filter -> getOptions ( ) , ] ) ; }
docstring: Helper method to render a FilterInterface to html.
  
  @param FilterInterface $filter
  @return array
docstring_tokens: Helper method to render a FilterInterface to html .