1 | <?php |
||
35 | class Encryptor extends BaseEncryptor |
||
36 | { |
||
37 | /** |
||
38 | * A non-NULL Initialization Vector. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $iv; |
||
43 | |||
44 | /** |
||
45 | * Encryptor constructor. |
||
46 | * |
||
47 | * @param string $sessionKey |
||
48 | * @param string $iv |
||
49 | */ |
||
50 | public function __construct($sessionKey, $iv) |
||
56 | |||
57 | /** |
||
58 | * Decrypt data. |
||
59 | * |
||
60 | * @param $encrypted |
||
61 | * |
||
62 | * @return \EasyWeChat\Support\Collection |
||
63 | */ |
||
64 | public function decryptData($encrypted) |
||
70 | |||
71 | /** |
||
72 | * Decrypt data. |
||
73 | * |
||
74 | * @param string $encrypted |
||
75 | * |
||
76 | * @return array |
||
77 | * |
||
78 | * @throws EncryptionException |
||
79 | */ |
||
80 | private function decrypt($encrypted) |
||
98 | |||
99 | /** |
||
100 | * Return AESKey. |
||
101 | * |
||
102 | * @return string |
||
103 | * |
||
104 | * @throws InvalidConfigException |
||
105 | */ |
||
106 | protected function getAESKey() |
||
114 | } |
||
115 |
Overwriting private methods is generally fine as long as you also use private visibility. It might still be preferable for understandability to use a different method name.