1 | <?php |
||
22 | class Mailer |
||
23 | { |
||
24 | /** |
||
25 | * Configuration with ordered senders |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | private $configuration = []; |
||
30 | |||
31 | /** |
||
32 | * Senders for email sending |
||
33 | * |
||
34 | * @var SenderInterface[] |
||
35 | */ |
||
36 | private $senders = []; |
||
37 | |||
38 | /** |
||
39 | * Repositories list for senders |
||
40 | * |
||
41 | * @var RepositoryInterface[] |
||
42 | */ |
||
43 | private $repositories = []; |
||
44 | |||
45 | /** |
||
46 | * @var ParameterResolverInterface |
||
47 | */ |
||
48 | private $parameterResolver; |
||
49 | |||
50 | /** |
||
51 | * @var LoggerInterface |
||
52 | */ |
||
53 | private $logger; |
||
54 | |||
55 | /** |
||
56 | * EmailSender constructor. |
||
57 | * |
||
58 | * @param ParameterResolverInterface $parameterResolver |
||
59 | * @param LoggerInterface $logger |
||
60 | */ |
||
61 | public function __construct(ParameterResolverInterface $parameterResolver, LoggerInterface $logger) |
||
66 | |||
67 | /** |
||
68 | * Set senders |
||
69 | * |
||
70 | * @param array $senders |
||
71 | */ |
||
72 | public function setSenders(array $senders) |
||
76 | |||
77 | /** |
||
78 | * @param RepositoryInterface[] $repositories |
||
79 | */ |
||
80 | public function setRepositories(array $repositories) |
||
84 | |||
85 | /** |
||
86 | * @param array $configuration |
||
87 | */ |
||
88 | public function setConfiguration(array $configuration) |
||
92 | |||
93 | /** |
||
94 | * Send email template |
||
95 | * |
||
96 | * @param TemplateInterface $template |
||
97 | * @param array|string $emails |
||
98 | * @param null|MessageOptionsInterface $options |
||
99 | * |
||
100 | * @return int |
||
101 | */ |
||
102 | public function send(TemplateInterface $template, $emails, ?MessageOptionsInterface $options = null): int |
||
134 | |||
135 | /** |
||
136 | * Make email engine sender |
||
137 | * |
||
138 | * @param string $senderName |
||
139 | * @param MessageOptionsInterface|null $options |
||
140 | * |
||
141 | * @return SenderInterface |
||
142 | */ |
||
143 | protected function makeSender(string $senderName, ?MessageOptionsInterface $options = null): SenderInterface |
||
154 | |||
155 | /** |
||
156 | * Make email engine repository |
||
157 | * |
||
158 | * @param string $repositoryName |
||
159 | * @param TemplateInterface $template |
||
160 | * @param array $arguments |
||
161 | * |
||
162 | * @return RepositoryInterface |
||
163 | */ |
||
164 | protected function makeRepository(string $repositoryName, TemplateInterface $template, array $arguments = []): RepositoryInterface |
||
172 | } |
||
173 |
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: