| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 3 | public function map($type) |
|
| 28 | { |
||
| 29 | 3 | $mapping = []; |
|
| 30 | 3 | if (is_dir($type)) { |
|
| 31 | 3 | exec('find '.$type.' -name "*.'.$type.'" -exec md5sum {} \; | sort', $contents); |
|
| 32 | 3 | if ($contents !== null) { |
|
| 33 | 3 | foreach ($contents as $i => $row) { |
|
| 34 | 3 | list($hash, $file) = explode(" ", $row); |
|
| 35 | 3 | $file = substr($file, strlen($type) + 1); |
|
| 36 | 3 | $mapping[$file] = $hash; |
|
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 40 | 3 | return $mapping; |
|
| 41 | } |
||
| 42 | } |
||
| 43 |