| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function __invoke(MessageEvent $messageEvent): void |
||
| 33 | { |
||
| 34 | $message = $messageEvent->getMessage(); |
||
| 35 | if (!$message instanceof Email) { |
||
| 36 | return; |
||
| 37 | } |
||
| 38 | // symfony/mime 5.2 deprecated fromString |
||
| 39 | if (method_exists(Address::class, 'create')) { |
||
| 40 | $toEmailAddress = Address::create($this->fromEmailAddress); |
||
| 41 | } else { |
||
| 42 | $toEmailAddress = Address::fromString($this->fromEmailAddress); |
||
|
|
|||
| 43 | } |
||
| 44 | $message->from($toEmailAddress); |
||
| 45 | } |
||
| 47 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.