| Conditions | 2 |
| Paths | 3 |
| Total Lines | 37 |
| Code Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | public function execute() |
||
| 45 | { |
||
| 46 | $payload = $this->getContent(); |
||
| 47 | |||
| 48 | try { |
||
| 49 | $this->mailer->send($payload['message']); |
||
|
|
|||
| 50 | |||
| 51 | $this->logger->info( |
||
| 52 | self::class, |
||
| 53 | [ |
||
| 54 | 'email' => $payload['email'], |
||
| 55 | 'subject' => $payload['subject'], |
||
| 56 | ] |
||
| 57 | ); |
||
| 58 | echo 'Subject <info>' . |
||
| 59 | $payload['subject'] . |
||
| 60 | '</info> email <info>' . |
||
| 61 | $payload['email'] . |
||
| 62 | '</info>' . |
||
| 63 | PHP_EOL; |
||
| 64 | } catch (\RuntimeException $e) { |
||
| 65 | $this->logger->error( |
||
| 66 | self::class, |
||
| 67 | [ |
||
| 68 | 'email' => $payload['email'], |
||
| 69 | 'subject' => $payload['subject'], |
||
| 70 | 'error' => $e->getMessage(), |
||
| 71 | ] |
||
| 72 | ); |
||
| 73 | echo '<error>' . $e->getMessage() . '</error> Subject <info>' . |
||
| 74 | $payload['subject'] . |
||
| 75 | '</info> email <info>' . |
||
| 76 | $payload['email'] . |
||
| 77 | '</info>' . |
||
| 78 | PHP_EOL; |
||
| 79 | } |
||
| 80 | } |
||
| 81 | } |
||
| 82 |
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: