| 1 | <?php |
||
| 15 | class EmailGateway extends Gateway |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var SendEmail |
||
| 19 | */ |
||
| 20 | private $sendEmail; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var EmailAddress |
||
| 24 | */ |
||
| 25 | private $from; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param SendEmail $sendEmail |
||
| 29 | * @param EmailAddress $from |
||
| 30 | */ |
||
| 31 | 3 | public function __construct(SendEmail $sendEmail, EmailAddress $from) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritdoc} |
||
| 39 | */ |
||
| 40 | 2 | protected function doSend(Notification $notification): void |
|
| 58 | |||
| 59 | /** |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | 3 | public function destinationType(): string |
|
| 66 | } |
||
| 67 |
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: