1 | <?php |
||
23 | class Mailer |
||
24 | { |
||
25 | /** |
||
26 | * Senders for email sending |
||
27 | * |
||
28 | * @var SenderInterface[] |
||
29 | */ |
||
30 | private $senders = []; |
||
31 | |||
32 | /** |
||
33 | * @var ContainerInterface |
||
34 | */ |
||
35 | private $container; |
||
36 | |||
37 | /** |
||
38 | * @var LoggerInterface |
||
39 | */ |
||
40 | private $logger; |
||
41 | |||
42 | /** |
||
43 | * EmailSender constructor. |
||
44 | * |
||
45 | * @param ContainerInterface $container |
||
46 | * @param LoggerInterface $logger |
||
47 | */ |
||
48 | public function __construct(ContainerInterface $container, LoggerInterface $logger) |
||
53 | |||
54 | /** |
||
55 | * Get senders |
||
56 | * |
||
57 | * @return array |
||
58 | */ |
||
59 | public function getSenders(): array |
||
63 | |||
64 | /** |
||
65 | * Set senders |
||
66 | * |
||
67 | * @param array $senders |
||
68 | */ |
||
69 | public function setSenders(array $senders): void |
||
73 | |||
74 | /** |
||
75 | * Send email template |
||
76 | * |
||
77 | * @param TemplateInterface $template |
||
78 | * @param array|string $emails |
||
79 | * @param null|MessageOptionsInterface $options |
||
80 | * |
||
81 | * @return int |
||
82 | */ |
||
83 | public function send(TemplateInterface $template, $emails, ?MessageOptionsInterface $options = null): int |
||
117 | |||
118 | /** |
||
119 | * Make email engine sender |
||
120 | * |
||
121 | * @param string $sender |
||
122 | * @param array $options |
||
123 | * |
||
124 | * @return SenderInterface |
||
125 | */ |
||
126 | protected function makeSender(string $sender, array $options = []): SenderInterface |
||
137 | |||
138 | /** |
||
139 | * Make email engine repository |
||
140 | * |
||
141 | * @param string $repository |
||
142 | * @param TemplateInterface $template |
||
143 | * @param array $arguments |
||
144 | * |
||
145 | * @return RepositoryInterface |
||
146 | */ |
||
147 | protected function makeRepository(string $repository, TemplateInterface $template, array $arguments = []): RepositoryInterface |
||
155 | } |
||
156 |
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: