Checks if the types of returned expressions are compatible with the hinted types.
1 | <?php |
||
2 | |||
3 | namespace hiqdev\billing\hiapi\method\Delete; |
||
4 | |||
5 | use hiqdev\billing\hiapi\method\Create\MethodCreateCommand; |
||
6 | use hiqdev\billing\hiapi\method\MethodRepository; |
||
7 | use hiqdev\php\billing\method\Method; |
||
8 | |||
9 | class MethodDeleteAction |
||
10 | { |
||
11 | /** |
||
12 | * @var MethodRepository |
||
13 | */ |
||
14 | private $repo; |
||
15 | |||
16 | public function __construct(MethodRepository $repo) |
||
17 | { |
||
18 | $this->repo = $repo; |
||
19 | } |
||
20 | |||
21 | public function __invoke(MethodCreateCommand $command): Method |
||
22 | { |
||
23 | } |
||
0 ignored issues
–
show
|
|||
24 | } |
||
25 |
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: