1 | <?php |
||
18 | abstract class AbstractTemplate implements TemplateInterface, RepositoryAwareInterface, ParametersAwareInterface, AttachmentsAwareInterface |
||
19 | { |
||
20 | /** |
||
21 | * Template data |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $data = []; |
||
26 | |||
27 | /** |
||
28 | * Template options |
||
29 | * |
||
30 | * @var TemplateOptionsInterface |
||
31 | */ |
||
32 | protected $options; |
||
33 | |||
34 | /** |
||
35 | * Template repository |
||
36 | * |
||
37 | * @var RepositoryInterface |
||
38 | */ |
||
39 | protected $repository; |
||
40 | |||
41 | /** |
||
42 | * Parameter resolver |
||
43 | * |
||
44 | * @var ParameterResolverInterface |
||
45 | */ |
||
46 | protected $parameterResolver; |
||
47 | |||
48 | /** |
||
49 | * AbstractTemplate constructor. |
||
50 | * |
||
51 | * @param TemplateOptionsInterface $options |
||
52 | */ |
||
53 | public function __construct(TemplateOptionsInterface $options) |
||
57 | |||
58 | /** |
||
59 | * Set parameter resolver |
||
60 | * |
||
61 | * @param ParameterResolverInterface $parameterResolver |
||
62 | * |
||
63 | * @return mixed|void |
||
64 | */ |
||
65 | public function setParameterResolver(ParameterResolverInterface $parameterResolver) |
||
69 | |||
70 | /** |
||
71 | * Add data for template |
||
72 | * |
||
73 | * @param $key |
||
74 | * @param $value |
||
75 | */ |
||
76 | public function addData($key, $value) |
||
80 | |||
81 | /** |
||
82 | * Set repository |
||
83 | * |
||
84 | * @param RepositoryInterface $repository |
||
85 | */ |
||
86 | public function setRepository(RepositoryInterface $repository) |
||
90 | |||
91 | /** |
||
92 | * Get repository |
||
93 | * |
||
94 | * @return RepositoryInterface |
||
95 | */ |
||
96 | public function getRepository(): RepositoryInterface |
||
100 | |||
101 | /** |
||
102 | * Get email's subject |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getSubject(): string |
||
110 | |||
111 | /** |
||
112 | * Get email's body |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | public function getBody(): string |
||
120 | |||
121 | /** |
||
122 | * Get email's sender name |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getSenderName(): string |
||
130 | |||
131 | /** |
||
132 | * Get email's sender email |
||
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | public function getSenderEmail(): string |
||
140 | |||
141 | /** |
||
142 | * Get priority |
||
143 | * |
||
144 | * @return int |
||
145 | */ |
||
146 | public function getPriority(): int |
||
150 | |||
151 | /** |
||
152 | * Get template attachments |
||
153 | * |
||
154 | * @return AttachmentInterface[] |
||
155 | */ |
||
156 | public function getAttachments(): array |
||
169 | |||
170 | /** |
||
171 | * List template attachments |
||
172 | * |
||
173 | * @return AttachmentInterface[] |
||
174 | */ |
||
175 | public static function listAttachments(): array |
||
179 | |||
180 | /** |
||
181 | * Get arguments list |
||
182 | * |
||
183 | * @return array |
||
184 | */ |
||
185 | protected function getData(): array |
||
195 | } |
||
196 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: