1.2.655. Magic Visibility¶
Magic methods must be declared with public visibility. They cannot be private or protected.
Magic methods cannot be declared as static. They are always associated with an instance of a class and cannot be called statically.
<?php
class foo{
// magic method must bt public and non-static
public static function __clone($name) { }
// magic method can't be private
private function __get($name) { }
// magic method can't be protected
private function __set($name, $value) { }
// magic method can't be static
public static function __isset($name) { }
}
?>
See also Magic methods and PHP Magic Methods Explained.
1.2.655.2. Connex PHP features¶
1.2.655.2.1. Specs¶
Short name |
Classes/toStringPss |
Rulesets |
|
Exakat since |
0.8.4 |
Severity |
Major |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Available in |