Skip to content
Snippets Groups Projects
Commit 6eabf47c authored by Jared Hancock's avatar Jared Hancock
Browse files

lint: Properly analyze PHP abstract functions

parent 22c6efea
No related branches found
No related tags found
No related merge requests found
...@@ -73,13 +73,19 @@ class SourceAnalyzer extends Test { ...@@ -73,13 +73,19 @@ class SourceAnalyzer extends Test {
$scope = array(); $scope = array();
while ($token != "{") { while ($token != "{") {
list(,$token) = each($this->tokens); list(,$token) = each($this->tokens);
if (!is_array($token) switch ($token[0]) {
|| $token[0] == T_WHITESPACE) case T_WHITESPACE:
continue; continue;
if ($token[0] == T_STRING) case T_STRING:
$function['name'] = $token[1]; $function['name'] = $token[1];
elseif ($token[0] == T_VARIABLE) break;
case T_VARIABLE:
$scope[$token[1]] = 1; $scope[$token[1]] = 1;
break;
case ';':
// Abstract function -- no body will follow
return;
}
} }
// Start inside a block -- we've already consumed the { // Start inside a block -- we've already consumed the {
$this->checkVariableUsage($function, $scope, 1, $options); $this->checkVariableUsage($function, $scope, 1, $options);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment