1 | <?php |
||
19 | class NativeShare extends AbstractShare { |
||
20 | /** |
||
21 | * @var IServer $server |
||
22 | */ |
||
23 | private $server; |
||
24 | |||
25 | /** |
||
26 | * @var string $name |
||
27 | */ |
||
28 | private $name; |
||
29 | |||
30 | /** |
||
31 | * @var NativeState $state |
||
32 | */ |
||
33 | private $state; |
||
34 | |||
35 | /** |
||
36 | * @param IServer $server |
||
37 | * @param string $name |
||
38 | */ |
||
39 | 255 | public function __construct($server, $name) { |
|
44 | |||
45 | /** |
||
46 | * @throws \Icewind\SMB\Exception\ConnectionException |
||
47 | * @throws \Icewind\SMB\Exception\AuthenticationException |
||
48 | * @throws \Icewind\SMB\Exception\InvalidHostException |
||
49 | */ |
||
50 | 255 | protected function getState() { |
|
59 | |||
60 | /** |
||
61 | * Get the name of the share |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | 1 | public function getName() { |
|
68 | |||
69 | 255 | private function buildUrl($path) { |
|
79 | |||
80 | /** |
||
81 | * List the content of a remote folder |
||
82 | * |
||
83 | * @param string $path |
||
84 | * @return \Icewind\SMB\IFileInfo[] |
||
85 | * |
||
86 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
87 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
88 | */ |
||
89 | 255 | public function dir($path) { |
|
103 | |||
104 | /** |
||
105 | * @param string $path |
||
106 | * @return \Icewind\SMB\IFileInfo |
||
107 | */ |
||
108 | 33 | public function stat($path) { |
|
111 | |||
112 | 114 | public function getStat($path) { |
|
115 | |||
116 | /** |
||
117 | * Create a folder on the share |
||
118 | * |
||
119 | * @param string $path |
||
120 | * @return bool |
||
121 | * |
||
122 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
123 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
124 | */ |
||
125 | 255 | public function mkdir($path) { |
|
128 | |||
129 | /** |
||
130 | * Remove a folder on the share |
||
131 | * |
||
132 | * @param string $path |
||
133 | * @return bool |
||
134 | * |
||
135 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
136 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
137 | */ |
||
138 | 255 | public function rmdir($path) { |
|
141 | |||
142 | /** |
||
143 | * Delete a file on the share |
||
144 | * |
||
145 | * @param string $path |
||
146 | * @return bool |
||
147 | * |
||
148 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
149 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
150 | */ |
||
151 | 133 | public function del($path) { |
|
154 | |||
155 | /** |
||
156 | * Rename a remote file |
||
157 | * |
||
158 | * @param string $from |
||
159 | * @param string $to |
||
160 | * @return bool |
||
161 | * |
||
162 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
163 | * @throws \Icewind\SMB\Exception\AlreadyExistsException |
||
164 | */ |
||
165 | 28 | public function rename($from, $to) { |
|
168 | |||
169 | /** |
||
170 | * Upload a local file |
||
171 | * |
||
172 | * @param string $source local file |
||
173 | * @param string $target remove file |
||
174 | * @return bool |
||
175 | * |
||
176 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
177 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
178 | */ |
||
179 | 113 | public function put($source, $target) { |
|
189 | |||
190 | /** |
||
191 | * Download a remote file |
||
192 | * |
||
193 | * @param string $source remove file |
||
194 | * @param string $target local file |
||
195 | * @return bool |
||
196 | * |
||
197 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
198 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
199 | * @throws \Icewind\SMB\Exception\InvalidPathException |
||
200 | * @throws \Icewind\SMB\Exception\InvalidResourceException |
||
201 | */ |
||
202 | 44 | public function get($source, $target) { |
|
229 | |||
230 | /** |
||
231 | * Open a readable stream top a remote file |
||
232 | * |
||
233 | * @param string $source |
||
234 | * @return resource a read only stream with the contents of the remote file |
||
235 | * |
||
236 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
237 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
238 | */ |
||
239 | 29 | public function read($source) { |
|
244 | |||
245 | /** |
||
246 | * Open a readable stream top a remote file |
||
247 | * |
||
248 | * @param string $source |
||
249 | * @return resource a read only stream with the contents of the remote file |
||
250 | * |
||
251 | * @throws \Icewind\SMB\Exception\NotFoundException |
||
252 | * @throws \Icewind\SMB\Exception\InvalidTypeException |
||
253 | */ |
||
254 | 29 | public function write($source) { |
|
259 | |||
260 | /** |
||
261 | * Get extended attributes for the path |
||
262 | * |
||
263 | * @param string $path |
||
264 | * @param string $attribute attribute to get the info |
||
265 | * @return string the attribute value |
||
266 | */ |
||
267 | 14 | public function getAttribute($path, $attribute) { |
|
270 | |||
271 | /** |
||
272 | * Get extended attributes for the path |
||
273 | * |
||
274 | * @param string $path |
||
275 | * @param string $attribute attribute to get the info |
||
276 | * @param mixed $value |
||
277 | * @return string the attribute value |
||
278 | */ |
||
279 | 8 | public function setAttribute($path, $attribute, $value) { |
|
287 | |||
288 | /** |
||
289 | * @param string $path |
||
290 | * @param int $mode a combination of FileInfo::MODE_READONLY, FileInfo::MODE_ARCHIVE, FileInfo::MODE_SYSTEM and FileInfo::MODE_HIDDEN, FileInfo::NORMAL |
||
291 | * @return mixed |
||
292 | */ |
||
293 | 8 | public function setMode($path, $mode) { |
|
296 | |||
297 | /** |
||
298 | * @param string $path |
||
299 | * @return INotifyHandler |
||
300 | */ |
||
301 | public function notify($path) { |
||
310 | |||
311 | 255 | public function __destruct() { |
|
314 | } |
||
315 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: