Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public static function check($tokens, $absPath) |
||
13 | { |
||
14 | [$classes, $_] = ParseUseStatement::findClassReferences($tokens, $absPath); |
||
15 | |||
16 | $p = app(ErrorPrinter::class); |
||
17 | foreach ($classes as $class) { |
||
18 | self::$refCount++; |
||
19 | if (! self::exists($class['class'])) { |
||
20 | $p->wrongUsedClassError($absPath, $class['class'], $class['line']); |
||
21 | } |
||
22 | } |
||
23 | } |
||
24 | |||
36 |
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.