MailerTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMailer() 0 2 1
A setMailer() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Mailer;
13
14
use Symfony\Component\Mailer\MailerInterface;
15
16
/**
17
 * Mailer trait.
18
 *
19
 * @author webeweb <https://github.com/webeweb>
20
 * @package WBW\Bundle\CoreBundle\Mailer
21
 */
22
trait MailerTrait {
23
24
    /**
25
     * Mailer.
26
     *
27
     * @var MailerInterface|null
28
     */
29
    private $mailer;
30
31
    /**
32
     * Get the mailer.
33
     *
34
     * @return MailerInterface|null Returns the mailer.
35
     */
36
    public function getMailer(): ?MailerInterface {
37
        return $this->mailer;
38
    }
39
40
    /**
41
     * Set the mailer.
42
     *
43
     * @param MailerInterface|null $mailer The mailer.
44
     * @return self Returns this instance.
45
     */
46
    protected function setMailer(?MailerInterface $mailer): self {
47
        $this->mailer = $mailer;
48
        return $this;
49
    }
50
}
51