Completed
Push — master ( f62f21...f72c97 )
by Freek
05:09
created

Mail::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Spatie\Backup\Notifications\Senders;
4
5
use Illuminate\Mail\Message;
6
use Spatie\Backup\Notifications\BaseSender;
7
8
class Mail extends BaseSender
9
{
10
    /** @var \Illuminate\Contracts\Mail\Mailer */
11
    protected $mailer;
12
13
    /** @var array */
14
    protected $config;
15
16
    /**
17
     * @param \Illuminate\Contracts\Mail\Mailer       $mailer
18
     * @param \Illuminate\Contracts\Config\Repository $config
19
     */
20
    public function __construct($mailer, $config)
21
    {
22
        $this->config = $config->get('laravel-backup.notifications.mail');
0 ignored issues
show
Documentation Bug introduced by
It seems like $config->get('laravel-backup.notifications.mail') of type * is incompatible with the declared type array of property $config.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
23
24
        $this->mailer = $mailer;
25
    }
26
27
    public function send()
28
    {
29
        $this->mailer->raw($this->message, function (Message $message) {
30
31
            $message
32
                ->subject($this->subject)
33
                ->from($this->config['from'])
34
                ->to($this->config['to']);
35
        });
36
    }
37
}
38