Conditions | 2 |
Paths | 2 |
Total Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
25 | public function catchAll() : object |
||
26 | { |
||
27 | $title = " | Anax development utilities"; |
||
28 | $pages = [ |
||
29 | "" => "index", |
||
30 | "di" => "di", |
||
31 | "request" => "request", |
||
32 | "router" => "router", |
||
33 | "session" => "session", |
||
34 | "view" => "view", |
||
35 | ]; |
||
36 | |||
37 | $path = $this->di->get("router")->getMatchedPath(); |
||
38 | |||
39 | if (!array_key_exists($path, $pages)) { |
||
40 | throw new NotFoundException(); |
||
41 | } |
||
42 | |||
43 | $page = $this->di->get("page"); |
||
44 | $page->add( |
||
45 | "anax/v2/dev/{$pages[$path]}", |
||
46 | [ |
||
47 | "mount" => "dev/" |
||
48 | ] |
||
49 | ); |
||
50 | |||
51 | return $page->render([ |
||
52 | "title" => ucfirst($pages[$path]) . $title |
||
53 | ]); |
||
54 | } |
||
55 | } |
||
56 |