EmailTemplate::getSubjectKeyword()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\DTO;
4
5
use Stringable;
6
7
class EmailTemplate implements Stringable
8
{
9
    public function __construct(
10
        private string $name,
11
        private string $providerName,
12
        private string $username,
13
        private string $address,
14
        private ?string $subjectKeyword = null
15
    ) {}
16
17
    public function getName(): string
18
    {
19
        return $this->name;
20
    }
21
22
    public function getProviderName(): string
23
    {
24
        return $this->providerName;
25
    }
26
27
    public function getAddress(): string
28
    {
29
        return $this->address;
30
    }
31
32
    public function getSubjectKeyword(): ?string
33
    {
34
        return $this->subjectKeyword;
35
    }
36
37
    public function getFrom(): string
38
    {
39
        return sprintf('%s <%s>', $this->username, $this->address);
40
    }
41
42
    /**
43
     * {@inheritDoc}
44
     */
45
    public function __toString(): string
46
    {
47
        return $this->name;
48
    }
49
}
50