1 | <?php |
||
14 | class CreateMonthBillCommandHandler implements CommandHandlerInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var DoliDB |
||
18 | */ |
||
19 | private $db; |
||
20 | |||
21 | /** |
||
22 | * @var stdClass |
||
23 | */ |
||
24 | private $conf; |
||
25 | |||
26 | /** |
||
27 | * @var User |
||
28 | */ |
||
29 | private $user; |
||
30 | |||
31 | /** |
||
32 | * @var Translate |
||
33 | */ |
||
34 | private $langs; |
||
35 | |||
36 | /** |
||
37 | * @var MonthlyBillableQueryHandler |
||
38 | */ |
||
39 | private $queryHandler; |
||
40 | |||
41 | /** |
||
42 | * @var CreateReceiverMonthBillCommandHandler |
||
43 | */ |
||
44 | private $receiverMonthBillCommandHandler; |
||
45 | |||
46 | /** |
||
47 | * @param DoliDB $db |
||
48 | * @param stdClass $conf |
||
49 | * @param User $user |
||
50 | * @param Translate $langs |
||
51 | */ |
||
52 | public function __construct($db, $conf, $user, $langs) |
||
61 | |||
62 | /** |
||
63 | * @param CommandInterface|CreateMonthBillCommand $command |
||
64 | * |
||
65 | * @throws Exception |
||
66 | */ |
||
67 | public function handle(CommandInterface $command) |
||
88 | |||
89 | /** |
||
90 | * @param CreateMonthBillCommand $command |
||
91 | * @param MonthlyFlightBill $currentReceiver |
||
92 | */ |
||
93 | private function createBill($command, $currentReceiver) |
||
109 | } |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.