Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function pack(Packer $packer, $value) : ?string |
||
35 | { |
||
36 | if (!$value instanceof Error) { |
||
37 | return null; |
||
38 | } |
||
39 | |||
40 | [Keys::ERROR_STACK => $errorStack] = $value->toMap(); |
||
|
|||
41 | |||
42 | $packedError = $packer->packMapHeader(1); |
||
43 | $packedError .= $packer->packInt(Keys::ERROR_STACK); |
||
44 | $packedError .= $packer->packArrayHeader(\count($errorStack)); |
||
45 | foreach ($errorStack as $error) { |
||
46 | $packedError .= $packer->packMap($error); |
||
47 | } |
||
48 | |||
49 | return $packer->packExt(self::TYPE, $packedError); |
||
50 | } |
||
51 | |||
60 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.