SendMailEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
crap 1
1
<?php
2
3
namespace BrainExe\Core\Mail;
4
5
use BrainExe\Core\EventDispatcher\AbstractEvent;
6
7
/**
8
 * @api
9
 */
10
class SendMailEvent extends AbstractEvent
11
{
12
13
    const TYPE = 'email.send';
14
15
    /**
16
     * @var string
17
     */
18
    private $recipient;
19
20
    /**
21
     * @var string
22
     */
23
    private $subject;
24
25
    /**
26
     * @var string
27
     */
28
    private $body;
29
30
    /**
31
     * @param string $recipient
32
     * @param string $subject
33
     * @param string $body
34
     */
35 2
    public function __construct(string $recipient, string $subject, string $body)
36
    {
37 2
        parent::__construct(self::TYPE);
38
39 2
        $this->recipient = $recipient;
40 2
        $this->subject   = $subject;
41 2
        $this->body      = $body;
42 2
    }
43
44
    /**
45
     * @return string
46
     */
47 2
    public function getRecipient() : string
48
    {
49 2
        return $this->recipient;
50
    }
51
52
    /**
53
     * @return string
54
     */
55 2
    public function getSubject() : string
56
    {
57 2
        return $this->subject;
58
    }
59
60
    /**
61
     * @return string
62
     */
63 2
    public function getBody() : string
64
    {
65 2
        return $this->body;
66
    }
67
}
68