| Total Complexity | 7 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | class MailJob extends MongoJob implements MailSenderInterface |
||
| 24 | { |
||
| 25 | |||
| 26 | private $mail; |
||
| 27 | |||
| 28 | public static function create($payload = null) |
||
| 29 | { |
||
| 30 | if ($payload instanceof Message) { |
||
| 31 | return static::fromMessage($payload); |
||
| 32 | } |
||
| 33 | |||
| 34 | return parent::create($payload); |
||
| 35 | } |
||
| 36 | |||
| 37 | public static function fromMessage(Message $mail) |
||
| 42 | } |
||
| 43 | |||
| 44 | public static function fromMailSpec(string $mailServiceName, $options = null) |
||
| 45 | { |
||
| 46 | return parent::create([$mailServiceName, $options]); |
||
| 47 | } |
||
| 48 | |||
| 49 | public function execute() |
||
| 50 | { |
||
| 51 | $mail = $this->getContent(); |
||
| 52 | |||
| 53 | if (is_string($mail)) { |
||
| 54 | $mail = Message::fromString($mail); |
||
| 55 | } |
||
| 56 | |||
| 57 | $this->mail = $mail; |
||
| 58 | } |
||
| 59 | |||
| 60 | public function getMail() |
||
| 63 | } |
||
| 64 | } |
||
| 65 |