Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
24 | 7 | public static function fromString(Str $string): Value |
|
25 | { |
||
26 | 7 | $string = $string->toEncoding('ASCII'); |
|
27 | |||
28 | 7 | if ($string->length() !== 8) { |
|
29 | 1 | throw new StringNotOfExpectedLength($string, 8); |
|
30 | } |
||
31 | |||
32 | 6 | [, $value] = unpack('q', (string) $string); |
|
1 ignored issue
–
show
|
|||
33 | |||
34 | 6 | return new self(new Integer($value)); |
|
35 | } |
||
36 | |||
52 |
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.