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 | */ |
||
47 | public function __construct(ContainerInterface $container) |
||
51 | |||
52 | /** |
||
53 | * Get senders |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | public function getSenders(): array |
||
61 | |||
62 | /** |
||
63 | * Set senders |
||
64 | * |
||
65 | * @param array $senders |
||
66 | */ |
||
67 | public function setSenders(array $senders): void |
||
71 | |||
72 | /** |
||
73 | * Set Logger |
||
74 | * |
||
75 | * @param LoggerInterface $logger |
||
76 | */ |
||
77 | public function setLogger(LoggerInterface $logger): void |
||
81 | |||
82 | /** |
||
83 | * Send email template |
||
84 | * |
||
85 | * @param TemplateInterface $template |
||
86 | * @param array|string $emails |
||
87 | * @param null|MessageOptionsInterface $options |
||
88 | * |
||
89 | * @return int |
||
90 | */ |
||
91 | public function send(TemplateInterface $template, $emails, ?MessageOptionsInterface $options = null): int |
||
123 | |||
124 | /** |
||
125 | * Make email engine sender |
||
126 | * |
||
127 | * @param string $sender |
||
128 | * @param MessageOptionsInterface|null $options |
||
129 | * |
||
130 | * @return SenderInterface |
||
131 | */ |
||
132 | protected function makeSender(string $sender, ?MessageOptionsInterface $options = null): SenderInterface |
||
143 | |||
144 | /** |
||
145 | * Make email engine repository |
||
146 | * |
||
147 | * @param string $repository |
||
148 | * @param TemplateInterface $template |
||
149 | * @param array $arguments |
||
150 | * |
||
151 | * @return RepositoryInterface |
||
152 | */ |
||
153 | protected function makeRepository(string $repository, TemplateInterface $template, array $arguments = []): RepositoryInterface |
||
161 | } |
||
162 |
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: