A method or constant of a class has no visibility
What it finds
A method or constant of a class has no visibility
<?phpclass Cart{ const LIMIT = 3;tx0 reports: this constant has no visibility public const NAME = 'cart'; function total()tx0 reports: this method has no visibility { return 0; } static function make()tx0 reports: this method has no visibility { return new self(); } private function sum() { return 1; }} interface Shape{ function area();} Turn it on, off or suppress it
The rule runs from the all tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/php:member-without-visibility" = "note"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/php:member-without-visibility] reason="..."tx0 explain tx0/php:member-without-visibility shows the same in the terminal. Found a false positive? Report it.