| Conditions | 5 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 55 | public function sortByDate(): self |
||
| 56 | { |
||
| 57 | return $this->usort(function ($a, $b) { |
||
| 58 | if (!isset($a['date'])) { |
||
| 59 | return -1; |
||
| 60 | } |
||
| 61 | if (!isset($b['date'])) { |
||
| 62 | return 1; |
||
| 63 | } |
||
| 64 | if ($a['date'] == $b['date']) { |
||
| 65 | return 0; |
||
| 66 | } |
||
| 67 | |||
| 68 | return ($a['date'] > $b['date']) ? -1 : 1; |
||
| 69 | }); |
||
| 70 | } |
||
| 71 | } |
||
| 72 |
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.