1 | <?php |
||
15 | class File implements FileInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $path; |
||
21 | |||
22 | /** |
||
23 | * @var bool |
||
24 | */ |
||
25 | private $isDeleted = false; |
||
26 | |||
27 | /** |
||
28 | * @param $path |
||
29 | * @throws \ErrorException |
||
30 | */ |
||
31 | 27 | public function __construct($path) |
|
43 | |||
44 | /** |
||
45 | * @return int |
||
46 | */ |
||
47 | 3 | public function getSize() |
|
51 | |||
52 | /** |
||
53 | * @param string $string |
||
54 | * @param string $mode |
||
55 | */ |
||
56 | 12 | public function write($string, $mode = Mode::OVERWRITE) |
|
62 | |||
63 | /** |
||
64 | * @return string |
||
65 | */ |
||
66 | 3 | public function read() |
|
70 | |||
71 | /** |
||
72 | * @return string |
||
73 | */ |
||
74 | 21 | public function getPath() |
|
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | 3 | public function getName() |
|
86 | |||
87 | /** |
||
88 | * Delete the file |
||
89 | */ |
||
90 | 24 | public function delete() |
|
103 | } |