Subject::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php declare(strict_types = 1);
2
3
namespace JDR\Mailer\Part;
4
5
class Subject implements EmailPart
6
{
7
    /**
8
     * @var string
9
     */
10
    private $subject;
11
12
    /**
13
     * @var string[]
14
     */
15
    private $parameters;
16
17
    /**
18
     * Constructor.
19
     *
20
     * @param string $subject
21
     * @param string $parameters
22
     */
23 9
    public function __construct(string $subject, array $parameters = [])
24
    {
25 9
        $this->subject = $subject;
26 9
        $this->parameters = $parameters;
27 9
    }
28
29
    /**
30
     * Get subject of the message.
31
     *
32
     * @return string
33
     */
34 5
    public function getSubject(): string
35
    {
36 5
        return $this->subject;
37
    }
38
39
    /**
40
     * Get the parameters used in the subject.
41
     *
42
     * @return string[]
43
     */
44 7
    public function getParameters(): array
45
    {
46 7
        return $this->parameters;
47
    }
48
}
49