1 | <?php |
||
21 | final class LocalFile implements File |
||
22 | { |
||
23 | /** |
||
24 | * Path to the file. |
||
25 | * @var string |
||
26 | */ |
||
27 | private $path; |
||
28 | |||
29 | /** |
||
30 | * LocalFile constructor. |
||
31 | * @param string $path |
||
32 | */ |
||
33 | 3 | public function __construct($path) |
|
37 | |||
38 | /** |
||
39 | * Returns the content of the file as a string. |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | 1 | public function getContents() |
|
47 | |||
48 | /** |
||
49 | * Returns md5 hash of the file. |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function md5() |
|
57 | |||
58 | /** |
||
59 | * Returns an relative path to the file. |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 1 | public function path() |
|
67 | } |
||
68 |