protected getDefaultRouteName ( ReflectionClass $class, ReflectionMethod $method ) | ||
$class | ReflectionClass | |
$method | ReflectionMethod |
/** * {@inheritdoc} */ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) { $routeName = parent::getDefaultRouteName($class, $method); return preg_replace(['/(bundle|controller)_/', '/action(_\\d+)?$/', '/__/'], ['_', '\\1', '_'], $routeName); }
/** * Makes the default route name more sane by removing common keywords. * * @param ReflectionClass $class A ReflectionClass instance * @param ReflectionMethod $method A ReflectionMethod instance * @return string */ public function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) { $routeName = parent::getDefaultRouteName($class, $method); return str_replace(array('bundle', 'controller', 'action', '__'), array(null, null, null, '_'), $routeName); }
/** * Makes the default route name more sane by removing common keywords. * * @param ReflectionClass $class A ReflectionClass instance * @param ReflectionMethod $method A ReflectionMethod instance * @return string */ public function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) { $routeName = parent::getDefaultRouteName($class, $method); return preg_replace(array('/(bundle|controller)_/', '/action$/', '/__/'), array('_', null, '_'), $routeName); }
/** * Makes the default route name more sane by removing common keywords. * * @param \ReflectionClass $class A ReflectionClass instance * @param \ReflectionMethod $method A ReflectionMethod instance * @return string */ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) { $routeName = parent::getDefaultRouteName($class, $method); return preg_replace(array('/(module_|controller_?)/', '/__/'), array('_', '_'), $routeName); }
/** * Makes the default route name more sane by removing common keywords. * * @param \ReflectionClass $class A ReflectionClass instance * @param \ReflectionMethod $method A ReflectionMethod instance * * @return string The default route name */ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) { return preg_replace(array('/(_controller|controller)/', '/action/', '/__/'), array('_', '', '_'), parent::getDefaultRouteName($class, $method)); }