- Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
More generally, it appears that if the @codingStandardsIgnoreEnd line is after a function's prototype and before the closing } but the @codingStandardsIgnoreStart is above the function, everything following the @codingStandardsIgnoreEnd is treated as if it's not in the function.
This can be a problem if just the function prototype needs suppressing, but not the entire function, currently the only workaround is to suppress the entire function.
The following code demonstrates the issue:
<?php namespace A; // @codingStandardsIgnoreStart class lowerCamelCaseClass // @codingStandardsIgnoreEnd { private $memberVariable; // @codingStandardsIgnoreStart public function _functionWithAnUnderscorePrefix() // @codingStandardsIgnoreEnd { $this->memberVariable = 'string'; $this->memberVariable .= PHP_EOL; return $this->memberVariable; } }
While the class name can be suppressed to prevent the Class name "lowerCamelCaseClass" is not in camel caps format error, attempting to suppress the function name causes the three lines within the function to display a Visibility must be declared on property "$this" error.