1 | <?php |
||
16 | class WebDAVAdapter extends AbstractAdapter |
||
17 | { |
||
18 | use StreamedTrait; |
||
19 | use StreamedCopyTrait; |
||
20 | use NotSupportingVisibilityTrait; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected static $resultMap = [ |
||
26 | '{DAV:}getcontentlength' => 'size', |
||
27 | '{DAV:}getcontenttype' => 'mimetype', |
||
28 | 'content-length' => 'size', |
||
29 | 'content-type' => 'mimetype', |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * @var Client |
||
34 | */ |
||
35 | protected $client; |
||
36 | |||
37 | /** |
||
38 | * Constructor. |
||
39 | * |
||
40 | * @param Client $client |
||
41 | * @param string $prefix |
||
42 | */ |
||
43 | 66 | public function __construct(Client $client, $prefix = null) |
|
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | 12 | public function getMetadata($path) |
|
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | 6 | public function has($path) |
|
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | 15 | public function read($path) |
|
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | */ |
||
114 | 9 | public function write($path, $contents, Config $config) |
|
126 | |||
127 | /** |
||
128 | * {@inheritdoc} |
||
129 | */ |
||
130 | 3 | public function update($path, $contents, Config $config) |
|
134 | |||
135 | /** |
||
136 | * {@inheritdoc} |
||
137 | */ |
||
138 | 9 | public function rename($path, $newpath) |
|
157 | |||
158 | /** |
||
159 | * {@inheritdoc} |
||
160 | */ |
||
161 | 6 | public function delete($path) |
|
173 | |||
174 | /** |
||
175 | * {@inheritdoc} |
||
176 | */ |
||
177 | 6 | public function createDir($path, Config $config) |
|
188 | |||
189 | /** |
||
190 | * {@inheritdoc} |
||
191 | */ |
||
192 | 6 | public function deleteDir($dirname) |
|
196 | |||
197 | /** |
||
198 | * {@inheritdoc} |
||
199 | */ |
||
200 | 3 | public function listContents($directory = '', $recursive = false) |
|
225 | |||
226 | /** |
||
227 | * {@inheritdoc} |
||
228 | */ |
||
229 | 3 | public function getSize($path) |
|
233 | |||
234 | /** |
||
235 | * {@inheritdoc} |
||
236 | */ |
||
237 | 3 | public function getTimestamp($path) |
|
241 | |||
242 | /** |
||
243 | * {@inheritdoc} |
||
244 | */ |
||
245 | 3 | public function getMimetype($path) |
|
249 | |||
250 | /** |
||
251 | * Normalise a WebDAV repsonse object. |
||
252 | * |
||
253 | * @param array $object |
||
254 | * @param string $path |
||
255 | * |
||
256 | * @return array |
||
257 | */ |
||
258 | 15 | protected function normalizeObject(array $object, $path) |
|
275 | } |
||
276 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.