1 | <?php |
||
15 | abstract class FileAbstract |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $file; |
||
21 | |||
22 | /** |
||
23 | * File constructor. |
||
24 | * |
||
25 | * @param string $file |
||
26 | * |
||
27 | * @throws SourceUnavailableException |
||
28 | */ |
||
29 | public function __construct(string $file) |
||
33 | |||
34 | /** |
||
35 | * @return string |
||
36 | */ |
||
37 | protected function getFilePath() : string |
||
41 | |||
42 | /** |
||
43 | * @param string $file |
||
44 | * |
||
45 | * @throws SourceUnavailableException |
||
46 | */ |
||
47 | protected function setFilePath(string $file) |
||
58 | |||
59 | /** |
||
60 | * @param string $file |
||
61 | * |
||
62 | * @return bool |
||
63 | */ |
||
64 | protected function isFileReadable(string $file) : bool |
||
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | * |
||
72 | * @codeCoverageIgnore All covered, but analysis does't work with Generators. |
||
73 | * |
||
74 | * @throws SourceUnavailableException |
||
75 | */ |
||
76 | public function getContent() : \Generator |
||
90 | } |
||
91 |
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.