1 | <?php |
||
14 | class RawExtendedKeySerializer |
||
15 | { |
||
16 | /** |
||
17 | * @var EcAdapterInterface |
||
18 | */ |
||
19 | private $ecAdapter; |
||
20 | |||
21 | /** |
||
22 | * @var \BitWasp\Buffertools\Types\ByteString |
||
23 | */ |
||
24 | private $bytestring4; |
||
25 | |||
26 | /** |
||
27 | * @var \BitWasp\Buffertools\Types\Uint8 |
||
28 | */ |
||
29 | private $uint8; |
||
30 | |||
31 | /** |
||
32 | * @var \BitWasp\Buffertools\Types\Uint32 |
||
33 | */ |
||
34 | private $uint32; |
||
35 | |||
36 | /** |
||
37 | * @var \BitWasp\Buffertools\Types\ByteString |
||
38 | */ |
||
39 | private $bytestring32; |
||
40 | |||
41 | /** |
||
42 | * @var \BitWasp\Buffertools\Types\ByteString |
||
43 | */ |
||
44 | private $bytestring33; |
||
45 | |||
46 | /** |
||
47 | * RawExtendedKeySerializer constructor. |
||
48 | * @param EcAdapterInterface $ecAdapter |
||
49 | */ |
||
50 | 56 | public function __construct(EcAdapterInterface $ecAdapter) |
|
59 | |||
60 | /** |
||
61 | * @param RawKeyParams $keyParams |
||
62 | * @return BufferInterface |
||
63 | * @throws \Exception |
||
64 | */ |
||
65 | 24 | public function serialize(RawKeyParams $keyParams): BufferInterface |
|
76 | |||
77 | /** |
||
78 | * @param Parser $parser |
||
79 | * @return RawKeyParams |
||
80 | * @throws ParserOutOfRange |
||
81 | */ |
||
82 | 36 | public function fromParser(Parser $parser): RawKeyParams |
|
97 | } |
||
98 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.