Exemple #1
0
 /**
  * @test
  */
 public function shouldNotTransformWhenStringNotHaveNamespace()
 {
     //given
     $string = 'some_string';
     //when
     $namespace = ClassName::pathToFullyQualifiedName($string);
     //then
     $this->assertEquals('SomeString', $namespace);
 }
Exemple #2
0
 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!');
 }
Exemple #3
0
 private function getViewName()
 {
     return ClassName::pathToFullyQualifiedName($this->currentController) . '/' . $this->currentAction ?: '/';
 }