Conditions | 5 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
33 | 2 | public function queue(Mailer $mailer = null) |
|
34 | { |
||
35 | 2 | if ($mailer === null && $this->mailer === null) { |
|
36 | 1 | $mailer = Yii::$app->getMailer(); |
|
37 | 1 | } elseif ($mailer === null) { |
|
38 | 1 | $mailer = $this->mailer; |
|
39 | } |
||
40 | 2 | if (!$mailer instanceof Mailer) { |
|
41 | 1 | throw new InvalidConfigException('The mailer should be an instance of "\izumi\spoolmailer\Mailer".'); |
|
42 | } |
||
43 | 1 | return $mailer->queue($this); |
|
44 | } |
||
46 |