Conditions | 5 |
Paths | 16 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
14 | 10 | protected function normalizeResponse($response) |
|
15 | { |
||
16 | 10 | $normalizedPath = ltrim($this->removePathPrefix($response['path_display']), '/'); |
|
|
|||
17 | |||
18 | 10 | $normalizedResponse = ['path' => $normalizedPath]; |
|
19 | 10 | $normalizedResponse['timestamp'] = isset($response['server_modified']) ? |
|
20 | 10 | strtotime($response['server_modified']) : null; |
|
21 | 10 | $normalizedResponse['size'] = isset($response['size']) ? $response['size'] : null; |
|
22 | 10 | $normalizedResponse['bytes'] = isset($response['size']) ? $response['size'] : null; |
|
23 | |||
24 | 10 | $type = ($response['.tag'] === 'folder' ? 'dir' : 'file'); |
|
25 | 10 | $normalizedResponse['type'] = $type; |
|
26 | |||
27 | 10 | return array_filter($normalizedResponse); |
|
28 | } |
||
30 |