1 | <?php |
||
21 | class EmailSendCheck extends AbstractEmailCheck |
||
22 | { |
||
23 | const CHECK = 'email-send-check'; |
||
24 | const MESSAGE_BODY = 'This is a test, you don\'t need to reply this massage.'; |
||
25 | const SEND_INTERVAL = 600; |
||
26 | const SUBJECT_TEMPLATE = '%s:time:%d'; |
||
27 | |||
28 | /** |
||
29 | * @var int |
||
30 | */ |
||
31 | private $sendInterval; |
||
32 | |||
33 | /** |
||
34 | * @var Swift_Mailer $client |
||
35 | */ |
||
36 | private $mailer; |
||
37 | |||
38 | /** |
||
39 | * @var PersistCollectionInterface |
||
40 | */ |
||
41 | private $persistCollection; |
||
42 | |||
43 | /** |
||
44 | * @var EmailSendReceiveCollection |
||
45 | */ |
||
46 | private $emailSendReceiveCollection; |
||
47 | |||
48 | /** |
||
49 | * @var string; |
||
50 | */ |
||
51 | private $from; |
||
52 | |||
53 | /** |
||
54 | * @var string; |
||
55 | */ |
||
56 | private $toSubject; |
||
57 | |||
58 | /** |
||
59 | * @param string $checkNode |
||
60 | * @param Swift_Mailer $mailer |
||
61 | * @param EntityManager $doctrine |
||
|
|||
62 | * @param string $from |
||
63 | * @param string $toSubjects |
||
64 | * @param int $sendInterval |
||
65 | */ |
||
66 | 8 | public function __construct( |
|
82 | |||
83 | /** |
||
84 | * Check email can send and receive messages |
||
85 | * @return bool|void |
||
86 | * @throws EmailSendCheckException |
||
87 | */ |
||
88 | 7 | public function check() |
|
105 | |||
106 | /** |
||
107 | * @return Swift_Mailer |
||
108 | */ |
||
109 | 7 | public function getMailer() |
|
113 | |||
114 | /** |
||
115 | * @return PersistCollectionInterface |
||
116 | */ |
||
117 | 7 | public function getPersistCollection() |
|
121 | |||
122 | /** |
||
123 | * @return EmailSendReceiveCollection |
||
124 | */ |
||
125 | 7 | public function getEmailSendReceiveColl() |
|
129 | |||
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | 7 | public function getFrom() |
|
138 | |||
139 | /** |
||
140 | * @return string |
||
141 | */ |
||
142 | 7 | public function getToSubject() |
|
146 | |||
147 | /** |
||
148 | * @return int |
||
149 | */ |
||
150 | 7 | public function getSendInterval() |
|
154 | |||
155 | /** |
||
156 | * @param Swift_Mailer $mailer |
||
157 | */ |
||
158 | 8 | protected function setMailer(Swift_Mailer $mailer) |
|
162 | |||
163 | /** |
||
164 | * @param PersistCollectionInterface $persistCollection |
||
165 | */ |
||
166 | 8 | protected function setPersistCollection(PersistCollectionInterface $persistCollection) |
|
170 | |||
171 | /** |
||
172 | * @param EmailSendReceiveCollection $emailSendReceiveC |
||
173 | */ |
||
174 | 7 | protected function setEmailSendReceiveColl(EmailSendReceiveCollection $emailSendReceiveC) |
|
178 | |||
179 | /** |
||
180 | * @param string $from |
||
181 | */ |
||
182 | 8 | protected function setFrom($from) |
|
186 | |||
187 | /** |
||
188 | * @param string $toSubject |
||
189 | */ |
||
190 | 8 | protected function setToSubject($toSubject) |
|
194 | |||
195 | /** |
||
196 | * @return string |
||
197 | */ |
||
198 | 7 | protected function genEmailSubject() |
|
202 | |||
203 | /** |
||
204 | * @param int $sendInterval |
||
205 | */ |
||
206 | 8 | protected function setSendInterval($sendInterval) |
|
210 | |||
211 | /** |
||
212 | * @return EmailSendReceive |
||
213 | */ |
||
214 | 7 | protected function createEmailSendReceive() |
|
226 | |||
227 | /** |
||
228 | * @param Swift_Mime_Message $message |
||
229 | * @param EmailSendReceive $emailSendCheck |
||
230 | * @throws EmailSendCheckException |
||
231 | */ |
||
232 | 7 | protected function sendMessage(Swift_Mime_Message $message, EmailSendReceive $emailSendCheck) |
|
242 | |||
243 | /** |
||
244 | * @param EmailSendReceive $emailSendCheck |
||
245 | * @return Swift_Mime_MimePart |
||
246 | */ |
||
247 | 7 | protected function buildMessage(EmailSendReceive $emailSendCheck) |
|
256 | |||
257 | /** |
||
258 | * @param EmailSendReceive $emailSendCheck |
||
259 | */ |
||
260 | 3 | private function saveEmailSendReceive(EmailSendReceive $emailSendCheck) |
|
266 | |||
267 | /** |
||
268 | * @param EmailSendReceive $emailSendCheck |
||
269 | * @throws EmailSendCheckException |
||
270 | */ |
||
271 | 7 | private function performSend(EmailSendReceive $emailSendCheck) |
|
290 | } |
||
291 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.