Total Complexity | 4 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class File extends AbstractIO |
||
19 | { |
||
20 | |||
21 | protected $configDefaults = [ |
||
22 | 'line_separator' => "\n", |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | * |
||
28 | * @throws InvalidArgumentException |
||
29 | */ |
||
30 | 11 | public function getContent() |
|
31 | { |
||
32 | 11 | $file = $this->getFileLocation(); |
|
33 | |||
34 | 10 | $content = file_get_contents($file); |
|
35 | |||
36 | 10 | return explode( |
|
37 | 10 | $this->getConfig('line_separator'), |
|
|
|||
38 | 10 | $content |
|
39 | 10 | ); |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 8 | public function setContent($content) |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * Gets the file location from the config. |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | 12 | protected function getFileLocation() |
|
66 | } |
||
67 | |||
69 |