| Conditions | 2 |
| Paths | 2 |
| Total Lines | 5 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function generateAbsolute(string $name, array $parameters = [], string $scheme = null, string $host = null): string |
||
| 30 | { |
||
| 31 | try { |
||
| 32 | return $this->urlGenerator->generateAbsolute($name, $parameters, $scheme, $host); |
||
| 33 | } catch (RouteNotFoundException $e) { |
||
| 34 | // generate fallback URL |
||
| 48 |
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: