1 | <?php |
||
20 | class TextFileLoader |
||
21 | { |
||
22 | /* |
||
23 | * @var FileLocation |
||
24 | */ |
||
25 | private $fileLocation; |
||
26 | |||
27 | /** |
||
28 | * @var FileContent |
||
29 | */ |
||
30 | private $rawContent; |
||
31 | |||
32 | /** |
||
33 | * @var TextFile |
||
34 | */ |
||
35 | private $file; |
||
36 | |||
37 | /** |
||
38 | * @var TextFileLoaderValidator |
||
39 | */ |
||
40 | private $validator; |
||
41 | |||
42 | /** |
||
43 | * @param FileLocation $fileLocation |
||
44 | */ |
||
45 | 1 | public function __construct(FileLocation $fileLocation) |
|
49 | |||
50 | /** |
||
51 | * Load the file to memory |
||
52 | * |
||
53 | * @throws InvalidFileLocationException |
||
54 | * @throws InvalidFileTypeException |
||
55 | * @return TextFile The text file itself |
||
56 | */ |
||
57 | 3 | public function loadFile() |
|
64 | |||
65 | /** |
||
66 | * @return FileContent |
||
67 | */ |
||
68 | 1 | protected function loadFileFromDisk() |
|
72 | |||
73 | /** |
||
74 | * @return TextFile |
||
75 | */ |
||
76 | 1 | protected function createFileObject() |
|
81 | |||
82 | /** |
||
83 | * @throws InvalidFileLocationException |
||
84 | * @throws InvalidFileTypeException |
||
85 | * @return bool |
||
86 | */ |
||
87 | 3 | protected function validateFile() |
|
91 | } |
||
92 |