1 | <?php |
||
10 | class CheckIsQuery |
||
11 | { |
||
12 | public static function check($tokens, $absPath) |
||
13 | { |
||
14 | [$classes,] = ParseUseStatement::findClassReferences($tokens, $absPath); |
||
|
|||
15 | |||
16 | foreach ($classes as $class) { |
||
17 | $c = $class['class']; |
||
18 | if (self::isQueryClass($c)) { |
||
19 | app(ErrorPrinter::class)->queryInBlade($absPath, $class['class'], $class['line']); |
||
20 | } |
||
21 | } |
||
22 | } |
||
23 | |||
24 | public static function isQueryClass($class) |
||
30 | } |
||
31 |
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.