1 | <?php |
||
13 | class TextFile implements |
||
14 | ReadableFileInterface, |
||
15 | WritableFileInterface, |
||
16 | MeasurableFileInterface, |
||
17 | TypableFileInterface, |
||
18 | FileInterface, |
||
19 | TraversableFileInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $path; |
||
25 | |||
26 | /** |
||
27 | * @var ArrayObjectLine |
||
28 | */ |
||
29 | private $lines; |
||
30 | |||
31 | /** |
||
32 | * TextFile constructor. |
||
33 | * @param string $path |
||
34 | */ |
||
35 | 1 | public function __construct(string $path) |
|
40 | |||
41 | /** |
||
42 | * @return bool |
||
43 | */ |
||
44 | 2 | public function exists(): bool |
|
48 | |||
49 | /** |
||
50 | * @return bool |
||
51 | */ |
||
52 | 2 | public function isReadable(): bool |
|
56 | |||
57 | /** |
||
58 | * @return bool |
||
59 | */ |
||
60 | 2 | public function isWritable(): bool |
|
64 | |||
65 | public function read() |
||
71 | |||
72 | 1 | public function write() |
|
76 | |||
77 | /** |
||
78 | * @return int |
||
79 | */ |
||
80 | 3 | public function getSize(): int |
|
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | 2 | public function getType(): string |
|
92 | |||
93 | /** |
||
94 | * @return string |
||
95 | */ |
||
96 | 2 | public function getFilename(): string |
|
100 | |||
101 | /** |
||
102 | * @return string |
||
103 | */ |
||
104 | 2 | public function getPath(): string |
|
108 | |||
109 | /** |
||
110 | * @return string |
||
111 | */ |
||
112 | 2 | public function getPathName(): string |
|
116 | |||
117 | /** |
||
118 | * @return \ArrayIterator |
||
119 | */ |
||
120 | 1 | public function getIterator() |
|
124 | |||
125 | /** |
||
126 | * @param mixed $offset |
||
127 | * @return bool |
||
128 | */ |
||
129 | 2 | public function offsetExists($offset) |
|
133 | |||
134 | /** |
||
135 | * @param mixed $offset |
||
136 | * @return mixed |
||
137 | */ |
||
138 | 1 | public function offsetGet($offset) |
|
142 | |||
143 | /** |
||
144 | * @param mixed $offset |
||
145 | * @param mixed $value |
||
146 | */ |
||
147 | 1 | public function offsetSet($offset, $value) |
|
151 | |||
152 | /** |
||
153 | * @param mixed $offset |
||
154 | */ |
||
155 | 1 | public function offsetUnset($offset) |
|
159 | |||
160 | /** |
||
161 | * @return int |
||
162 | */ |
||
163 | 1 | public function count() |
|
167 | |||
168 | /** |
||
169 | * @inheritDoc |
||
170 | */ |
||
171 | 1 | public function __toString() |
|
175 | } |
||
176 |