original_string: public function controllerName() {
          $request = $this->stack->getCurrentRequest();
          if ($request instanceof Request) {
              $string = $request->get('_controller');
              $parts = explode('::', $string);
              $controller = $parts[0];
              $pattern = "#Controller\\\([a-zA-Z\\\]*)Controller#";
              $matches = array();
              preg_match($pattern, $controller, $matches);
              if (isset($matches[1])) {
                  return strtolower(str_replace('\\', '_', $matches[1]));
              }
  
              return '';
          }
  
          return '';
      }
code: public function controllerName() {
          $request = $this->stack->getCurrentRequest();
          if ($request instanceof Request) {
              $string = $request->get('_controller');
              $parts = explode('::', $string);
              $controller = $parts[0];
              $pattern = "#Controller\\\([a-zA-Z\\\]*)Controller#";
              $matches = array();
              preg_match($pattern, $controller, $matches);
              if (isset($matches[1])) {
                  return strtolower(str_replace('\\', '_', $matches[1]));
              }
  
              return '';
          }
  
          return '';
      }
code_tokens: public function controllerName ( ) { $ request = $ this -> stack -> getCurrentRequest ( ) ; if ( $ request instanceof Request ) { $ string = $ request -> get ( '_controller' ) ; $ parts = explode ( '::' , $ string ) ; $ controller = $ parts [ 0 ] ; $ pattern = "#Controller\\\([a-zA-Z\\\]*)Controller#" ; $ matches = array ( ) ; preg_match ( $ pattern , $ controller , $ matches ) ; if ( isset ( $ matches [ 1 ] ) ) { return strtolower ( str_replace ( '\\' , '_' , $ matches [ 1 ] ) ) ; } return '' ; } return '' ; }
docstring: Get current controller name
docstring_tokens: Get current controller name