1 | <?php |
||
17 | class EmailGateway extends Gateway |
||
18 | { |
||
19 | /** |
||
20 | * @var SendEmail |
||
21 | */ |
||
22 | private $sendEmail; |
||
23 | |||
24 | /** |
||
25 | * @var EmailAddress |
||
26 | */ |
||
27 | private $from; |
||
28 | |||
29 | /** |
||
30 | * @param SendEmail $sendEmail |
||
31 | * @param EmailAddress $from |
||
32 | */ |
||
33 | 3 | public function __construct(SendEmail $sendEmail, EmailAddress $from) |
|
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | 2 | protected function doSend(Notification $notification): void |
|
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 3 | public function sendsToDestination(Destination $destination): bool |
|
68 | } |
||
69 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: