1 | <?php |
||
15 | class PublicKeySerializer implements PublicKeySerializerInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var EcAdapter |
||
19 | */ |
||
20 | private $ecAdapter; |
||
21 | |||
22 | /** |
||
23 | * @param EcAdapter $ecAdapter |
||
24 | */ |
||
25 | 2543 | public function __construct(EcAdapter $ecAdapter) |
|
29 | |||
30 | /** |
||
31 | * @param PublicKey $publicKey |
||
32 | * @return BufferInterface |
||
33 | */ |
||
34 | 140 | private function doSerialize(PublicKey $publicKey) |
|
52 | |||
53 | /** |
||
54 | * @param PublicKeyInterface $publicKey |
||
55 | * @return BufferInterface |
||
56 | */ |
||
57 | 140 | public function serialize(PublicKeyInterface $publicKey): BufferInterface |
|
62 | |||
63 | /** |
||
64 | * @param BufferInterface $buffer |
||
65 | * @return PublicKeyInterface |
||
66 | */ |
||
67 | 265 | public function parse(BufferInterface $buffer): PublicKeyInterface |
|
82 | } |
||
83 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: