phpcheckstyle icon indicating copy to clipboard operation
phpcheckstyle copied to clipboard

Use the statement stack when processing annotations

Open tchule opened this issue 8 years ago • 0 comments

Instead of having in _processAnnotation :

if ($token == T_CLASS) {
	$this->_classSuppressWarnings[] = $suppressedCheck;
} elseif ($token == T_INTERFACE) {
	$this->_interfaceSuppressWarnings[] = $suppressedCheck;
} elseif ($token == T_FUNCTION) {
	$this->_functionSuppressWarnings[] = $suppressedCheck;
} elseif ($token == T_FILE) {
	$this->_fileSuppressWarnings[] = $suppressedCheck;
}

Store the annotation in the current stack item.

Then when analysing, check for all annontations in the stack (including parents).

tchule avatar Feb 21 '17 08:02 tchule