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

Message   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 86.36%

Importance

Changes 0
Metric Value
wmc 8
eloc 19
dl 0
loc 51
ccs 19
cts 22
cp 0.8636
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubject() 0 3 1
A __construct() 0 7 1
A getEmail() 0 3 1
A getName() 0 3 1
A addFile() 0 3 1
A getFiles() 0 3 1
A getContent() 0 3 1
A getTo() 0 3 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