1 | <?php |
||
11 | class ThreemaGateway_Handler_Action_TfaCallback_DeliveryReceipt extends ThreemaGateway_Handler_Action_TfaCallback_Abstract |
||
12 | { |
||
13 | /** |
||
14 | * @var int filter because of receipt type |
||
15 | */ |
||
16 | const FILTER_RECEIPT_TYPE_EQUAL = 1; |
||
17 | |||
18 | /** |
||
19 | * @var int filter because of receipt type |
||
20 | */ |
||
21 | const FILTER_RECEIPT_TYPE_MORETHAN = 2; |
||
22 | |||
23 | /** |
||
24 | * @var int filter because of receipt type |
||
25 | */ |
||
26 | const FILTER_RECEIPT_TYPE_LESSTHAN = 3; |
||
27 | |||
28 | /** |
||
29 | * @var array acknowledged message IDs |
||
30 | */ |
||
31 | protected $ackedMsgIds; |
||
32 | |||
33 | /** |
||
34 | * @var int type of delivery receipt |
||
35 | */ |
||
36 | protected $receiptType; |
||
37 | |||
38 | /** |
||
39 | * Prepare the message handling. Should be called before any other actions. |
||
40 | * |
||
41 | * @return bool |
||
42 | */ |
||
43 | public function prepareProcessing() |
||
50 | |||
51 | /** |
||
52 | * Filters the passed data/message. |
||
53 | * |
||
54 | * Returns "false" if the process should be canceled. Otherwise "true". |
||
55 | * |
||
56 | * @param int $filterType please use the constants FILTER_* |
||
57 | * @param mixed $filterData any data the filter uses |
||
58 | * @param bool $failOnError whether the filter should fail on errors (true) |
||
59 | * or silently ignore them (false) |
||
60 | * |
||
61 | * @throws XenForo_Exception |
||
62 | * @return bool |
||
63 | */ |
||
64 | protected function applyFilter($filterType, $filterData, $failOnError = true) |
||
92 | |||
93 | /** |
||
94 | * Does all steps needed to do before processing data. |
||
95 | * |
||
96 | * Returns "false" if the process should be canceled. Otherwise "true". |
||
97 | * |
||
98 | * @throws XenForo_Exception |
||
99 | * @return bool |
||
100 | */ |
||
101 | protected function preProcessPending() |
||
113 | |||
114 | /** |
||
115 | * Verifies & saves data for one confirm request. |
||
116 | * |
||
117 | * Returns "false" if the process should be canceled. Otherwise "true". |
||
118 | * |
||
119 | * @param array $processOptions please include 'saveKey', |
||
120 | * 'saveKeyReceiptType' and |
||
121 | * 'saveKeyReceiptTypeLargest' |
||
122 | * |
||
123 | * @return bool |
||
124 | */ |
||
125 | protected function processConfirmRequest($confirmRequest, array $processOptions = []) |
||
169 | |||
170 | /** |
||
171 | * Checks whether the previously saved receipt type is smaller than the |
||
172 | * one got currently. |
||
173 | * |
||
174 | * @param array $confirmRequest the confirm request |
||
175 | * @param array $oldProviderData old data read |
||
176 | * @param array $setData new data to set |
||
177 | * @param array $processOptions custom options (optional) |
||
178 | * |
||
179 | * @throws XenForo_Exception |
||
180 | * @return bool |
||
181 | */ |
||
182 | protected function preSaveData(array $confirmRequest, array &$oldProviderData, array &$setData, array $processOptions = []) |
||
196 | /** |
||
197 | * Calls 2FA provider verification if it could do some blocking. |
||
198 | * |
||
199 | * @param array $confirmRequest the confirm request |
||
200 | * @param array $providerData merged provider data |
||
201 | * @param array $processOptions custom options (optional) |
||
202 | * |
||
203 | * @throws XenForo_Exception |
||
204 | * @return bool |
||
205 | */ |
||
206 | protected function preSaveDataMerged(array $confirmRequest, array &$providerData, array $processOptions = []) |
||
230 | } |
||
231 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.