| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function create(User $user): bool |
||
| 31 | { |
||
| 32 | $ScheduleCount = $this->service->getByUserId($user->id)->count(); |
||
| 33 | |||
| 34 | $maxScheduleCount = 20; |
||
| 35 | |||
| 36 | if ($ScheduleCount > $maxScheduleCount) { |
||
| 37 | throw new Exception('You Cannot create more than 20 Schedules. Delete one first', 401); |
||
| 38 | } |
||
| 41 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: