Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
40 | 2 | protected function doSend(Notification $notification): void |
|
41 | { |
||
42 | /** @var EmailDestination $destination */ |
||
43 | 2 | $destination = $notification->destination(); |
|
44 | 2 | $email = new Email( |
|
45 | 2 | $notification->subject()->subject(), |
|
46 | 2 | $notification->body()->body(), |
|
47 | 2 | $this->from, |
|
48 | 2 | $destination->to(), |
|
49 | 2 | $destination->cc(), |
|
50 | 2 | $destination->bcc() |
|
51 | ); |
||
52 | try { |
||
53 | 2 | $this->sendEmail->execute($email); |
|
54 | 1 | } catch (EmailNotSentException $e) { |
|
55 | 1 | throw new NotificationNotSentException($notification, $e); |
|
1 ignored issue
–
show
|
|||
56 | } |
||
57 | 1 | } |
|
58 | |||
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: