| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class ActionCalculateAction |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var ActionRepository |
||
| 13 | */ |
||
| 14 | private $repo; |
||
| 15 | |||
| 16 | public function __construct(ActionRepository $repo) |
||
| 17 | { |
||
| 18 | $this->repo = $repo; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function __invoke(ActionCalculateCommand $command): Action |
||
| 22 | { |
||
| 23 | $this->checkRequiredInput($command); |
||
|
|
|||
| 24 | // $action = new Action(); |
||
| 25 | // $this->repo->calculate($action); |
||
| 26 | |||
| 27 | // return $action; |
||
| 28 | } |
||
| 29 | |||
| 30 | protected function checkRequiredInput(ActionCalculateCommand $command): void |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
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: