Passed
Push — master ( 66fdc9...e2b180 )
by Alexander
08:00 queued 05:21
created

Message::getFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Service;
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)
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