MailOptions   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 91
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 9
lcom 0
cbo 2
dl 0
loc 91
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubject() 0 4 1
A setSubject() 0 5 1
A getSmtp() 0 4 1
A setSmtp() 0 5 2
A getFrom() 0 4 1
A setFrom() 0 5 1
A getTo() 0 4 1
A setTo() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Acelaya\Website\Options;
5
6
use Zend\Stdlib\AbstractOptions;
7
8
class MailOptions extends AbstractOptions
9
{
10
    /**
11
     * @var SmtpOptions
12
     */
13
    protected $smtp = null;
14
    /**
15
     * @var string
16
     */
17
    protected $from = '';
18
    /**
19
     * @var string
20
     */
21
    protected $to = '';
22
    /**
23
     * @var string
24
     */
25
    protected $subject = 'Alejandro Celaya | Contact form';
26
27
    /**
28 2
     * @return string
29
     */
30 2
    public function getSubject(): string
31
    {
32
        return $this->subject;
33
    }
34
35
    /**
36
     * @param string $subject
37 2
     * @return $this|MailOptions
38
     */
39 2
    public function setSubject(string $subject): MailOptions
40 2
    {
41
        $this->subject = $subject;
42
        return $this;
43
    }
44
45
    /**
46 1
     * @return SmtpOptions|null
47
     */
48 1
    public function getSmtp(): SmtpOptions
49
    {
50
        return $this->smtp;
51
    }
52
53
    /**
54
     * @param SmtpOptions|array $smtp
55 1
     * @return $this|MailOptions
56
     */
57 1
    public function setSmtp($smtp): MailOptions
58 1
    {
59
        $this->smtp = is_array($smtp) ? new SmtpOptions($smtp) : $smtp;
60
        return $this;
61
    }
62
63
    /**
64 2
     * @return string
65
     */
66 2
    public function getFrom(): string
67
    {
68
        return $this->from;
69
    }
70
71
    /**
72
     * @param string $from
73 2
     * @return $this|MailOptions
74
     */
75 2
    public function setFrom(string $from): MailOptions
76 2
    {
77
        $this->from = $from;
78
        return $this;
79
    }
80
81
    /**
82 2
     * @return string
83
     */
84 2
    public function getTo(): string
85
    {
86
        return $this->to;
87
    }
88
89
    /**
90
     * @param string $to
91 2
     * @return $this|MailOptions
92
     */
93 2
    public function setTo(string $to): MailOptions
94 2
    {
95
        $this->to = $to;
96
        return $this;
97
    }
98
}
99