Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
12 | 3 | public function __construct($filePath) |
|
13 | { |
||
14 | 3 | parent::__construct(); |
|
15 | |||
16 | 3 | if (!File::isFile($filePath)) { |
|
17 | 1 | throw new Exception("Cannot read file: $filePath"); |
|
18 | } |
||
19 | |||
20 | 2 | $fileContent = file_get_contents($filePath); |
|
21 | 2 | $this->setContent($fileContent); |
|
22 | |||
23 | 2 | $lastModified = new DateTime(); |
|
24 | 2 | $lastModified->setTimestamp( File::lastModified($filePath) ); |
|
25 | |||
26 | 2 | $this->setLastModified($lastModified); |
|
27 | |||
28 | 2 | $this->isNotModified(App::make('request')); |
|
29 | } |
||
30 | } |