1 | <?php |
||
18 | class SendReceiveCheck implements CheckInterface |
||
19 | { |
||
20 | const EMAIL_SEND_CHECK_MSG = '%s:Email send check %s'; |
||
21 | const EMAIL_RECEIVE_CHECK_MSG = '%s:Email receive check %s'; |
||
22 | const CHECK_OK = 'OK'; |
||
23 | const CHECK_FAIL = 'FAIL'; |
||
24 | const ERROR_MSG = 'Error:%s'; |
||
25 | |||
26 | /** |
||
27 | * @var LoggerInterface |
||
28 | */ |
||
29 | private $healthCheckerLogger; |
||
30 | |||
31 | /** |
||
32 | * @var EmailSendCheck |
||
33 | */ |
||
34 | private $emailSendCheck; |
||
35 | |||
36 | /** |
||
37 | * @var EmailReceiveCheck |
||
38 | */ |
||
39 | private $emailReceiveCheck; |
||
40 | |||
41 | /** |
||
42 | * Init Dependency |
||
43 | * @param LoggerInterface $healthCheckerLogger |
||
44 | * @param EmailSendCheck $emailSendCheck |
||
45 | * @param EmailReceiveCheck $emailReceiveCheck |
||
46 | */ |
||
47 | public function __construct( |
||
56 | |||
57 | /** |
||
58 | * Check email send&receive |
||
59 | * |
||
60 | * @return ResultInterface |
||
61 | */ |
||
62 | public function check() |
||
77 | |||
78 | /** |
||
79 | * Return a label describing this test instance. |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getLabel() |
||
87 | |||
88 | /** |
||
89 | * @return LoggerInterface |
||
90 | */ |
||
91 | protected function getHealthCheckerLogger() |
||
95 | |||
96 | /** |
||
97 | * @return EmailReceiveCheck |
||
98 | */ |
||
99 | protected function getEmailReceiveCheck() |
||
103 | |||
104 | /** |
||
105 | * @return EmailSendCheck |
||
106 | */ |
||
107 | protected function getEmailSendCheck() |
||
111 | |||
112 | /** |
||
113 | * @param LoggerInterface $healthCheckerLogger |
||
114 | */ |
||
115 | protected function setHealthCheckerLogger(LoggerInterface $healthCheckerLogger) |
||
119 | |||
120 | /** |
||
121 | * @param EmailReceiveCheck $emailReceiveCheck |
||
122 | */ |
||
123 | protected function setEmailReceiveCheck(EmailReceiveCheck $emailReceiveCheck) |
||
127 | |||
128 | /** |
||
129 | * @param EmailSendCheck $emailSendCheck |
||
130 | */ |
||
131 | protected function setEmailSendCheck(EmailSendCheck $emailSendCheck) |
||
135 | |||
136 | /** |
||
137 | * @param HCCheckInterface $emailCheck |
||
138 | * @param string $checkMsg |
||
139 | * |
||
140 | * @return CheckResult |
||
141 | */ |
||
142 | private function emailCheck(HCCheckInterface $emailCheck, $checkMsg) |
||
154 | |||
155 | /** |
||
156 | * @param string $checkStatus |
||
157 | * @param string $checkIndent |
||
158 | * |
||
159 | * @return array |
||
160 | */ |
||
161 | private function getCheckTags($checkStatus, $checkIndent) |
||
168 | |||
169 | /** |
||
170 | * @param string $checkMsg |
||
171 | * @param string $checkIndent |
||
172 | * @param string $checkStatus |
||
173 | */ |
||
174 | private function logSuccessCheck($checkMsg, $checkIndent, $checkStatus = self::CHECK_OK) |
||
187 | |||
188 | /** |
||
189 | * @param string $checkMsg |
||
190 | * @param string $checkIndent |
||
191 | * @param string $errorMsg |
||
192 | * @param string $checkStatus |
||
193 | */ |
||
194 | private function logFailCheck($checkMsg, $checkIndent, $errorMsg, $checkStatus = self::CHECK_FAIL) |
||
209 | } |
||
210 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.