/** * @test */ public function shouldNotTransformWhenStringNotHaveNamespace() { //given $string = 'some_string'; //when $namespace = ClassName::pathToFullyQualifiedName($string); //then $this->assertEquals('SomeString', $namespace); }
public function createController(RouteRule $routeRule) { $controllerName = ClassName::pathToFullyQualifiedName($routeRule->getController()); foreach ($this->controllerNamespaces as $controllerNamespace) { $controller = $controllerNamespace . $controllerName . "Controller"; if (class_exists($controller)) { return $this->getInstance($routeRule, $controller); } } throw new ControllerNotFoundException('Controller [' . $controllerName . '] for URI [' . $routeRule->getUri() . '] does not exist!'); }
private function getViewName() { return ClassName::pathToFullyQualifiedName($this->currentController) . '/' . $this->currentAction ?: '/'; }