Total Complexity | 2 |
Total Lines | 15 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class CurlStrategy implements StrategyInterface |
||
12 | { |
||
13 | /** |
||
14 | * @param Options|null $options |
||
15 | */ |
||
16 | public function __construct(null|Options $options = null) |
||
17 | { |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @param string $url |
||
22 | * @return Response |
||
23 | */ |
||
24 | public function sendRequest(string $url): Response |
||
26 | // TODO: Implement sendRequest() method. |
||
27 | } |
||
28 | } |
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: