1 | <?php |
||
13 | class Encryptor |
||
14 | { |
||
15 | /** |
||
16 | * ID. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $id; |
||
21 | |||
22 | /** |
||
23 | * Token. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $token; |
||
28 | |||
29 | /** |
||
30 | * AES key. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $AESKey; |
||
35 | |||
36 | /** |
||
37 | * Block size. |
||
38 | * |
||
39 | * @var int |
||
40 | */ |
||
41 | protected $blockSize; |
||
42 | |||
43 | /** |
||
44 | * Constructor. |
||
45 | * |
||
46 | * @param string $id |
||
47 | * @param string $token |
||
48 | * @param string $AESKey |
||
49 | * |
||
50 | * @throws RuntimeException |
||
51 | */ |
||
52 | public function __construct($id, $token, $AESKey) |
||
63 | |||
64 | /** |
||
65 | * Encrypt the message and return XML. |
||
66 | * |
||
67 | * @param string $xml |
||
68 | * @param string $nonce |
||
69 | * @param int $timestamp |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function encryptMsg($xml, $nonce = null, $timestamp = null) |
||
93 | |||
94 | /** |
||
95 | * Decrypt message. |
||
96 | * |
||
97 | * @param string $msgSignature |
||
98 | * @param string $nonce |
||
99 | * @param string $timestamp |
||
100 | * @param string $postXML |
||
|
|||
101 | * |
||
102 | * @throws EncryptionException |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | public function decryptEcho($msgSignature, $nonce, $timestamp, $echo) |
||
112 | |||
113 | /** |
||
114 | * Decrypt message. |
||
115 | * |
||
116 | * @param string $msgSignature |
||
117 | * @param string $nonce |
||
118 | * @param string $timestamp |
||
119 | * @param string $postXML |
||
120 | * |
||
121 | * @throws EncryptionException |
||
122 | * |
||
123 | * @return array |
||
124 | */ |
||
125 | public function decryptMsg($msgSignature, $nonce, $timestamp, $postXML) |
||
143 | |||
144 | /** |
||
145 | * Get SHA1. |
||
146 | * |
||
147 | * @throws EncryptionException |
||
148 | * |
||
149 | * @return string |
||
150 | */ |
||
151 | public function getSHA1() |
||
162 | |||
163 | /** |
||
164 | * Encode string. |
||
165 | * |
||
166 | * @param string $text |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | public function encode($text) |
||
186 | |||
187 | /** |
||
188 | * Decode string. |
||
189 | * |
||
190 | * @param string $decrypted |
||
191 | * |
||
192 | * @return string |
||
193 | */ |
||
194 | public function decode($decrypted) |
||
204 | |||
205 | /** |
||
206 | * Return AESKey. |
||
207 | * |
||
208 | * @throws InvalidConfigException |
||
209 | * |
||
210 | * @return string |
||
211 | */ |
||
212 | protected function getAESKey() |
||
224 | |||
225 | /** |
||
226 | * Encrypt string. |
||
227 | * |
||
228 | * @param string $text |
||
229 | * @param string $corpId |
||
230 | * |
||
231 | * @throws EncryptionException |
||
232 | * |
||
233 | * @return string |
||
234 | */ |
||
235 | private function encrypt($text, $corpId) |
||
251 | |||
252 | /** |
||
253 | * Decrypt message. |
||
254 | * |
||
255 | * @param string $encrypted |
||
256 | * @param string $corpId |
||
257 | * |
||
258 | * @throws EncryptionException |
||
259 | * |
||
260 | * @return string |
||
261 | */ |
||
262 | private function decrypt($encrypted, $corpId) |
||
296 | |||
297 | /** |
||
298 | * Generate random string. |
||
299 | * |
||
300 | * @return string |
||
301 | */ |
||
302 | private function getRandomStr() |
||
306 | } |
||
307 |
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.