1 | <?php |
||
14 | class PublicKeyFactory |
||
15 | { |
||
16 | /** |
||
17 | * @param string $hex |
||
18 | * @param EcAdapterInterface|null $ecAdapter |
||
19 | * @return PublicKeyInterface |
||
20 | * @throws \Exception |
||
21 | */ |
||
22 | 86 | public static function fromHex(string $hex, EcAdapterInterface $ecAdapter = null): PublicKeyInterface |
|
26 | |||
27 | /** |
||
28 | * @param BufferInterface $buffer |
||
29 | * @param EcAdapterInterface|null $ecAdapter |
||
30 | * @return PublicKeyInterface |
||
31 | */ |
||
32 | 108 | public static function fromBuffer(BufferInterface $buffer, EcAdapterInterface $ecAdapter = null): PublicKeyInterface |
|
38 | |||
39 | /** |
||
40 | * @param BufferInterface|string $hex |
||
41 | * @param EcAdapterInterface|null $ecAdapter |
||
42 | * @return bool |
||
43 | */ |
||
44 | 2 | public static function validateHex($hex, EcAdapterInterface $ecAdapter = null) |
|
53 | } |
||
54 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.