| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | private function sortDefectsByNamespace(array $defects) |
||
| 35 | { |
||
| 36 | $result = array(); |
||
| 37 | ksort($defects); |
||
| 38 | |||
| 39 | foreach($defects as $file => $fileDefects) |
||
| 40 | { |
||
| 41 | $namespace = implode('/', explode('/', $file, -1)); |
||
| 42 | |||
| 43 | if(! isset($result[$namespace])) |
||
| 44 | { |
||
| 45 | $result[$namespace] = array(); |
||
| 46 | } |
||
| 47 | |||
| 48 | $result[$namespace][$file] = $fileDefects; |
||
| 49 | } |
||
| 50 | |||
| 51 | return $result; |
||
| 52 | } |
||
| 53 | |||
| 58 | } |
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.