Passed
Push — master ( e13c15...e39a87 )
by Alexander
03:50
created

Message::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 5
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Contact;
6
7
use Psr\Http\Message\UploadedFileInterface;
8
9
final class Message
10
{
11
    private string $name;
12
    private string $email;
13
    private string $subject;
14
    private string $content;
15
    private array $files = [];
16
    private string $to;
17
18 2
    public function __construct(string $name, string $email, string $subject, string $content, string $to)
19
    {
20 2
        $this->name = $name;
21 2
        $this->email = $email;
22 2
        $this->subject = $subject;
23 2
        $this->content = $content;
24 2
        $this->to = $to;
25 2
    }
26
27
    public function addFile(UploadedFileInterface $file): void
28
    {
29
        $this->files[] = $file;
30
    }
31
32 2
    public function getName(): string
33
    {
34 2
        return $this->name;
35
    }
36
37 2
    public function getEmail(): string
38
    {
39 2
        return $this->email;
40
    }
41
42 2
    public function getSubject(): string
43
    {
44 2
        return $this->subject;
45
    }
46
47 2
    public function getContent(): string
48
    {
49 2
        return $this->content;
50
    }
51
52 2
    public function getFiles(): array
53
    {
54 2
        return $this->files;
55
    }
56
57 2
    public function getTo(): string
58
    {
59 2
        return $this->to;
60
    }
61
}
62