| Total Complexity | 3 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class AccountPolicy extends OwnershipPolicy |
||
| 17 | { |
||
| 18 | protected $service; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * AccountPolicy constructor. |
||
| 22 | * |
||
| 23 | * @param $service |
||
| 24 | */ |
||
| 25 | public function __construct(AccountServiceContract $service) |
||
| 26 | { |
||
| 27 | $this->service = $service; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function create(User $user): bool |
||
| 38 | } |
||
|
|
|||
| 39 | } |
||
| 41 |
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: