Code Duplication    Length = 61-61 lines in 2 locations

src/Part/Message.php 1 location

@@ 5-65 (lines=61) @@
2
3
namespace JDR\Mailer\Part;
4
5
class Message implements EmailPart
6
{
7
    /**
8
     * @var string
9
     */
10
    private $contentType;
11
12
    /**
13
     * @var string
14
     */
15
    private $body;
16
17
    /**
18
     * @var string[]
19
     */
20
    private $parameters;
21
22
    /**
23
     * Constructor.
24
     *
25
     * @param string $contentType
26
     * @param string $body
27
     * @param string[] $parameters
28
     */
29
    public function __construct(string $contentType, string $body, array $parameters = [])
30
    {
31
        $this->contentType = $contentType;
32
        $this->body = $body;
33
        $this->parameters = $parameters;
34
    }
35
36
    /**
37
     * Get content type of the message.
38
     *
39
     * @return string
40
     */
41
    public function getContentType(): string
42
    {
43
        return $this->contentType;
44
    }
45
46
    /**
47
     * Get body of the message.
48
     *
49
     * @return string
50
     */
51
    public function getBody(): string
52
    {
53
        return $this->body;
54
    }
55
56
    /**
57
     * Get parameters of the message.
58
     *
59
     * @return string[]
60
     */
61
    public function getParameters(): array
62
    {
63
        return $this->parameters;
64
    }
65
}
66

src/Part/Template.php 1 location

@@ 5-65 (lines=61) @@
2
3
namespace JDR\Mailer\Part;
4
5
class Template implements EmailPart
6
{
7
    /**
8
     * @var string
9
     */
10
    private $contentType;
11
12
    /**
13
     * @var string
14
     */
15
    private $path;
16
17
    /**
18
     * @var string[]
19
     */
20
    private $parameters;
21
22
    /**
23
     * Constructor.
24
     *
25
     * @param string $contentType
26
     * @param string $path
27
     * @param string[] $parameters
28
     */
29
    public function __construct(string $contentType, string $path, array $parameters = [])
30
    {
31
        $this->contentType = $contentType;
32
        $this->path = $path;
33
        $this->parameters = $parameters;
34
    }
35
36
    /**
37
     * Get content type of the template.
38
     *
39
     * @return string
40
     */
41
    public function getContentType(): string
42
    {
43
        return $this->contentType;
44
    }
45
46
    /**
47
     * Get path of the template.
48
     *
49
     * @return string
50
     */
51
    public function getPath(): string
52
    {
53
        return $this->path;
54
    }
55
56
    /**
57
     * Get parameters used in the template.
58
     *
59
     * @return string
60
     */
61
    public function getParameters(): array
62
    {
63
        return $this->parameters;
64
    }
65
}
66