Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0185 |
Changes | 0 |
1 | <?php |
||
38 | 11 | public static function fromString(Str $string): Value |
|
39 | { |
||
40 | 11 | $string = $string->toEncoding('ASCII'); |
|
41 | |||
42 | 11 | if ($string->length() !== 1) { |
|
43 | throw new StringNotOfExpectedLength($string, 1); |
||
44 | } |
||
45 | |||
46 | 11 | [, $octet] = unpack('C', (string) $string); |
|
1 ignored issue
–
show
|
|||
47 | |||
48 | 11 | return new self(new Integer($octet)); |
|
49 | } |
||
50 | |||
74 |
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.