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 {
$scope = array();
while ($token != "{") {
list(,$token) = each($this->tokens);
if (!is_array($token)
|| $token[0] == T_WHITESPACE)
switch ($token[0]) {
case T_WHITESPACE:
continue;
if ($token[0] == T_STRING)
case T_STRING:
$function['name'] = $token[1];
elseif ($token[0] == T_VARIABLE)
break;
case T_VARIABLE:
$scope[$token[1]] = 1;
break;
case ';':
// Abstract function -- no body will follow
return;
}
}
// Start inside a block -- we've already consumed the {
$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