1 | <?php declare(strict_types=1); |
||
28 | final class OpensslKey |
||
29 | { |
||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $key; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $algo; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | private $ivr; |
||
44 | |||
45 | /** |
||
46 | * OpensslKey constructor. |
||
47 | * |
||
48 | * @param string $algo Algo to use for HKDF |
||
49 | * @param string $key Key |
||
50 | * @param string $ivr Initialization vactor |
||
51 | * @throws InvalidKeyException |
||
52 | */ |
||
53 | 34 | public function __construct(string $algo, string $key, string $ivr) |
|
74 | |||
75 | /** |
||
76 | * Generate the authentication key |
||
77 | * |
||
78 | * @param string $info |
||
79 | * @return string |
||
80 | */ |
||
81 | 25 | public function authenticationKey(string $info): string |
|
85 | |||
86 | /** |
||
87 | * Generate the encryption key |
||
88 | * |
||
89 | * @param string $info |
||
90 | * @return string |
||
91 | */ |
||
92 | 26 | public function encryptionKey(string $info): string |
|
96 | |||
97 | /** |
||
98 | * Derive a key with differing authinfo strings |
||
99 | * |
||
100 | * @param string $info Info parameter to provide to hash_hkdf |
||
101 | * @return string |
||
102 | */ |
||
103 | 28 | public function deriveKey(string $info): string |
|
109 | |||
110 | /** |
||
111 | * Generate a new key that meets requirements for dcrypt |
||
112 | * |
||
113 | * @param int $size Size of key in bytes |
||
|
|||
114 | * @return string |
||
115 | * @throws InvalidKeyException |
||
116 | */ |
||
117 | 23 | public static function create(int $bytes = 2048): string |
|
125 | } |
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.