| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace nyx\notify\transports; |
||
| 38 | public function send(interfaces\Notifiable $notifiable, interfaces\Notification $notification) |
||
| 39 | { |
||
| 40 | /* @var mail\interfaces\Mailable $notification */ |
||
| 41 | if (!$this->supports($notification)) { |
||
|
|
|||
| 42 | throw new \InvalidArgumentException('The given Notification is not supported (did you forget to implement the Mailable Interface?).'); |
||
| 43 | } |
||
| 44 | |||
| 45 | if (false === $notifiable->routeNotification('mail', $message = $notification->toMail($notifiable))) { |
||
| 46 | return; |
||
| 47 | } |
||
| 48 | |||
| 49 | // The Notification might have built a subject during the toMail() call, but that's optional. |
||
| 50 | // If no subject is available, we are going to use the humanized name of the Notification's class. |
||
| 51 | if (empty($message->getSubject())) { |
||
| 52 | $message->setSubject(utils\str\Cases::title(utils\str\Cases::delimit(class_basename($notification), ' '))); |
||
| 53 | } |
||
| 54 | |||
| 55 | // And finally - just send the message. |
||
| 56 | $this->mailer->send($message); |
||
| 57 | } |
||
| 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: