Passed
Pull Request — master (#91)
by Alexander
23:47
created

Message::getFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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