| 1 | <?php |
||
| 9 | class TextFileReader implements FileReaderInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $path; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * TextFileReader constructor. |
||
| 18 | * @param string $path |
||
| 19 | */ |
||
| 20 | 1 | public function __construct(string $path) |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @inheritDoc |
||
| 27 | */ |
||
| 28 | 4 | public function readFile():FileInterface |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | 1 | public function getPath():string |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @param string $path |
||
| 48 | */ |
||
| 49 | 4 | private function validate(string $path) |
|
| 55 | |||
| 56 | /** |
||
| 57 | * @param string $path |
||
| 58 | * @throws IOException |
||
| 59 | */ |
||
| 60 | 4 | private function validatePath(string $path) |
|
| 66 | |||
| 67 | /** |
||
| 68 | * @param string $path |
||
| 69 | * @throws IOException |
||
| 70 | */ |
||
| 71 | 2 | private function validateType(string $path) |
|
| 77 | |||
| 78 | /** |
||
| 79 | * @param string $path |
||
| 80 | * @throws IOException |
||
| 81 | */ |
||
| 82 | 2 | private function validateReadable(string $path) |
|
| 88 | } |
||
| 89 |