| Conditions | 3 |
| Paths | 6 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.4746 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 1 | public function handle(): void |
|
| 30 | { |
||
| 31 | try { |
||
| 32 | 1 | $todayGames = $this->NFL->getTodayGames(); |
|
| 33 | |||
| 34 | 1 | if (is_null($todayGames)) { |
|
| 35 | exit($this->line('Sorry, there is no games scheduled for today.')); |
||
| 36 | } |
||
| 37 | |||
| 38 | 1 | $printer = new Printer($this); |
|
| 39 | |||
| 40 | 1 | $printer->renderGamesList($todayGames); |
|
| 41 | } catch (ErrorException $e) { |
||
| 42 | exit($this->line('Sorry, there was a problem fetching the remote data.')); |
||
| 43 | } |
||
| 46 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.