1 | <?php |
||
19 | class EmailSendCheck extends AbstractEmailCheck |
||
20 | { |
||
21 | const CHECK = 'email-send-check'; |
||
22 | const MESSAGE_BODY = 'This is a test, you don\'t need to reply this massage.'; |
||
23 | const SEND_INTERVAL = 600; |
||
24 | const SUBJECT_TEMPLATE = '%s:#%d'; |
||
25 | |||
26 | /** |
||
27 | * @var int |
||
28 | */ |
||
29 | private $sendInterval; |
||
30 | |||
31 | /** |
||
32 | * @var Swift_Mailer $client |
||
33 | */ |
||
34 | private $mailer; |
||
35 | |||
36 | /** |
||
37 | * @var EntityManager |
||
38 | */ |
||
39 | private $doctrine; |
||
40 | |||
41 | /** |
||
42 | * @var string; |
||
43 | */ |
||
44 | private $from; |
||
45 | |||
46 | /** |
||
47 | * @var string; |
||
48 | */ |
||
49 | private $toSubject; |
||
50 | |||
51 | /** |
||
52 | * @param string $checkNode |
||
53 | * @param Swift_Mailer $mailer |
||
54 | * @param EntityManager $doctrine |
||
55 | * @param string $from |
||
56 | * @param string $toSubjects |
||
57 | * @param int $sendInterval |
||
58 | */ |
||
59 | 4 | public function __construct( |
|
75 | |||
76 | /** |
||
77 | * Check email can send and receive messages |
||
78 | * @return bool|void |
||
79 | * @throws EmailSendCheckException |
||
80 | */ |
||
81 | 4 | public function check() |
|
94 | |||
95 | /** |
||
96 | * @return Swift_Mailer |
||
97 | */ |
||
98 | 4 | public function getMailer() |
|
102 | |||
103 | /** |
||
104 | * @return EntityManager |
||
105 | */ |
||
106 | 4 | public function getDoctrine() |
|
110 | |||
111 | /** |
||
112 | * @return string |
||
113 | */ |
||
114 | 4 | public function getFrom() |
|
118 | |||
119 | /** |
||
120 | * @return string |
||
121 | */ |
||
122 | 4 | public function getToSubject() |
|
126 | |||
127 | /** |
||
128 | * @return int |
||
129 | */ |
||
130 | 4 | public function getSendInterval() |
|
134 | |||
135 | /** |
||
136 | * @param Swift_Mailer $mailer |
||
137 | */ |
||
138 | 4 | protected function setMailer(Swift_Mailer $mailer) |
|
142 | |||
143 | /** |
||
144 | * @param EntityManager $doctrine |
||
145 | */ |
||
146 | 4 | protected function setDoctrine(EntityManager $doctrine) |
|
150 | |||
151 | /** |
||
152 | * @param string $from |
||
153 | */ |
||
154 | 4 | protected function setFrom($from) |
|
158 | |||
159 | /** |
||
160 | * @param string $toSubject |
||
161 | */ |
||
162 | 4 | protected function setToSubject($toSubject) |
|
166 | |||
167 | /** |
||
168 | * @param EmailSendReceive $emailSendCheck |
||
169 | * @return string |
||
170 | */ |
||
171 | 4 | protected function genEmailSubject(EmailSendReceive $emailSendCheck) |
|
175 | |||
176 | /** |
||
177 | * @param int $sendInterval |
||
178 | */ |
||
179 | 4 | protected function setSendInterval($sendInterval) |
|
183 | |||
184 | /** |
||
185 | * @return EmailSendReceive |
||
186 | */ |
||
187 | 4 | protected function createEmailSendReceive() |
|
203 | |||
204 | /** |
||
205 | * @param Swift_Mime_Message $message |
||
206 | * @param EmailSendReceive $emailSendCheck |
||
207 | * @throws EmailSendCheckException |
||
208 | */ |
||
209 | 4 | protected function sendMessage(Swift_Mime_Message $message, EmailSendReceive $emailSendCheck) |
|
220 | |||
221 | /** |
||
222 | * @param EmailSendReceive $emailSendCheck |
||
223 | * @return Swift_Mime_MimePart |
||
224 | */ |
||
225 | 4 | protected function buildMessage(EmailSendReceive $emailSendCheck) |
|
234 | |||
235 | /** |
||
236 | * @param EmailSendReceive $emailSendCheck |
||
237 | */ |
||
238 | 4 | private function saveEmailSendReceive(EmailSendReceive $emailSendCheck) |
|
243 | |||
244 | /** |
||
245 | * @param EmailSendReceive $emailSendCheck |
||
246 | * @throws EmailSendCheckException |
||
247 | */ |
||
248 | 4 | private function performSend(EmailSendReceive $emailSendCheck) |
|
263 | } |
||
264 |
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: