Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.1406 |
Changes | 0 |
1 | <?php |
||
34 | 2 | public function run(): string |
|
35 | { |
||
36 | 2 | $uri = $this->uri ?? $_SERVER['REQUEST_URI']; |
|
37 | |||
38 | 2 | $this->partialParse->setFilter($uri); |
|
39 | |||
40 | try { |
||
41 | 2 | $this->partialParse->execute(); |
|
42 | |||
43 | 2 | $filename = ltrim($uri === '/' ? 'index.html' : "{$uri}.html", '/'); |
|
44 | |||
45 | 2 | return @file_get_contents("{$this->rootDirectory}/{$filename}"); |
|
46 | } catch (ResourceNotFoundException $e) { |
||
47 | throw Http::notFound($uri); |
||
48 | } |
||
49 | } |
||
50 | } |
||
51 |