Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
51 | 14 | public function getContents(): string |
|
52 | { |
||
53 | 14 | $contents = file_get_contents($this->path); |
|
54 | |||
55 | 14 | if ($contents === false) { |
|
56 | 2 | throw new FileCouldNotBeOpenedException(ErrorMessages::FILE_COULD_NOT_BE_OPENED); |
|
57 | } |
||
58 | |||
59 | 12 | if ($contents === '') { |
|
60 | 2 | throw new EmptyFile(ErrorMessages::EMPTY_FILE); |
|
61 | } |
||
62 | |||
63 | 10 | return $contents; |
|
64 | } |
||
74 |