1 | <?php |
||
19 | class Local implements File |
||
20 | { |
||
21 | /** |
||
22 | * FileInfo |
||
23 | * |
||
24 | * @var \SplFileInfo |
||
25 | */ |
||
26 | protected $fileInfo; |
||
27 | |||
28 | /** |
||
29 | * Constructor |
||
30 | * |
||
31 | * @param SplFileInfo $fileInfo |
||
32 | */ |
||
33 | 19 | public function __construct(SplFileInfo $fileInfo) |
|
37 | |||
38 | /** |
||
39 | * FileInfo getter. |
||
40 | * |
||
41 | * @return SplFileInfo |
||
42 | */ |
||
43 | 1 | public function getFileInfo() |
|
47 | |||
48 | /** |
||
49 | * Return the filesize. |
||
50 | * |
||
51 | * @return integer |
||
52 | */ |
||
53 | 1 | public function getSize(): int |
|
57 | |||
58 | /** |
||
59 | * Return the filename. |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 1 | public function getFilename(): string |
|
67 | |||
68 | /** |
||
69 | * Return the full path and filename. |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | 2 | public function getPathname(): string |
|
77 | |||
78 | /** |
||
79 | * Return the path. |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | 1 | public function getPath() |
|
87 | |||
88 | /** |
||
89 | * Return last modified date as unix timestamp. |
||
90 | * |
||
91 | * @return integer |
||
92 | */ |
||
93 | 1 | public function getMTime(): int |
|
97 | |||
98 | /** |
||
99 | * Return whether the file is writable or not. |
||
100 | * |
||
101 | * @return boolean |
||
102 | */ |
||
103 | 1 | public function isWritable(): bool |
|
107 | |||
108 | /** |
||
109 | * Deletes the file. |
||
110 | * |
||
111 | * @throws \phpbu\App\Exception |
||
112 | */ |
||
113 | 2 | public function unlink() |
|
122 | } |
||
123 |