| Conditions | 5 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 16 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 57 | View Code Duplication | public function sortByWeight(): self |
|
| 58 | { |
||
| 59 | return $this->usort(function ($a, $b) { |
||
| 60 | if (!isset($a['weight'])) { |
||
| 61 | return -1; |
||
| 62 | } |
||
| 63 | if (!isset($b['weight'])) { |
||
| 64 | return 1; |
||
| 65 | } |
||
| 66 | if ($a['weight'] == $b['weight']) { |
||
| 67 | return 0; |
||
| 68 | } |
||
| 69 | |||
| 70 | return ($a['weight'] > $b['weight']) ? -1 : 1; |
||
| 71 | }); |
||
| 72 | } |
||
| 73 | } |
||
| 74 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.