This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | /* |
||
6 | * Copyright (C) 2020-2025 Iain Cambridge |
||
7 | * |
||
8 | * This program is free software: you can redistribute it and/or modify |
||
9 | * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by |
||
10 | * the Free Software Foundation, either version 2.1 of the License, or |
||
11 | * (at your option) any later version. |
||
12 | * |
||
13 | * This program is distributed in the hope that it will be useful, |
||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
16 | * GNU Lesser General Public License for more details. |
||
17 | * |
||
18 | * You should have received a copy of the GNU General Public License |
||
19 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
||
20 | */ |
||
21 | |||
22 | namespace Parthenon\Notification; |
||
23 | |||
24 | class Email implements EmailInterface |
||
25 | { |
||
26 | private ?string $subject = null; |
||
27 | |||
28 | private ?string $fromAddress = null; |
||
29 | |||
30 | private ?string $fromName = null; |
||
31 | |||
32 | private ?string $toAddress = null; |
||
33 | |||
34 | private ?string $toName = null; |
||
35 | |||
36 | private ?string $content = null; |
||
37 | |||
38 | private ?string $templateName = null; |
||
39 | |||
40 | private array $templateVariables = []; |
||
41 | |||
42 | /** |
||
43 | * @var Attachment[] |
||
44 | */ |
||
45 | private array $attachments = []; |
||
46 | |||
47 | public function getSubject(): ?string |
||
48 | { |
||
49 | return $this->subject; |
||
50 | } |
||
51 | |||
52 | public function setSubject(?string $subject): self |
||
53 | { |
||
54 | $this->subject = $subject; |
||
55 | |||
56 | return $this; |
||
57 | } |
||
58 | |||
59 | public function getFromAddress(): ?string |
||
60 | { |
||
61 | return $this->fromAddress; |
||
62 | } |
||
63 | |||
64 | public function setFromAddress(?string $fromAddress): self |
||
65 | { |
||
66 | $this->fromAddress = $fromAddress; |
||
67 | |||
68 | return $this; |
||
69 | } |
||
70 | |||
71 | public function getFromName(): ?string |
||
72 | { |
||
73 | return $this->fromName; |
||
74 | } |
||
75 | |||
76 | public function setFromName(?string $fromName): self |
||
77 | { |
||
78 | $this->fromName = $fromName; |
||
79 | |||
80 | return $this; |
||
81 | } |
||
82 | |||
83 | public function getToAddress(): ?string |
||
84 | { |
||
85 | return $this->toAddress; |
||
86 | } |
||
87 | |||
88 | public function setToAddress(?string $toAddress): self |
||
89 | { |
||
90 | $this->toAddress = $toAddress; |
||
91 | |||
92 | return $this; |
||
93 | } |
||
94 | |||
95 | public function getToName(): ?string |
||
96 | { |
||
97 | return $this->toName; |
||
98 | } |
||
99 | |||
100 | public function setToName(?string $toName): self |
||
101 | { |
||
102 | $this->toName = $toName; |
||
103 | |||
104 | return $this; |
||
105 | } |
||
106 | |||
107 | public function getContent(): ?string |
||
108 | { |
||
109 | return $this->content; |
||
110 | } |
||
111 | |||
112 | public function setContent(?string $content): self |
||
113 | { |
||
114 | $this->content = $content; |
||
115 | |||
116 | return $this; |
||
117 | } |
||
118 | |||
119 | public function getTemplateName(): string |
||
120 | { |
||
121 | return $this->templateName; |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
122 | } |
||
123 | |||
124 | public function setTemplateName(string $templateName): self |
||
125 | { |
||
126 | $this->templateName = $templateName; |
||
127 | |||
128 | return $this; |
||
129 | } |
||
130 | |||
131 | public function setTemplateVariables(array $templateVariables): self |
||
132 | { |
||
133 | $this->templateVariables = $templateVariables; |
||
134 | |||
135 | return $this; |
||
136 | } |
||
137 | |||
138 | public function getTemplateVariables(): array |
||
139 | { |
||
140 | return $this->templateVariables; |
||
141 | } |
||
142 | |||
143 | public function isTemplate(): bool |
||
144 | { |
||
145 | return !empty($this->templateName); |
||
146 | } |
||
147 | |||
148 | public function addAttachment(Attachment $attachment): self |
||
149 | { |
||
150 | $this->attachments[] = $attachment; |
||
151 | |||
152 | return $this; |
||
153 | } |
||
154 | |||
155 | /** |
||
156 | * @return Attachment[] |
||
157 | */ |
||
158 | public function getAttachments(): array |
||
159 | { |
||
160 | return $this->attachments; |
||
161 | } |
||
162 | } |
||
163 |