A magic method is declared with a signature PHP does not accept

tx0/php:magic-method-signaturedefaulterrorreliability/api-misusedepth fastbug

What it finds

A magic method is declared with a signature PHP does not accept

Example from the rule's tests
<?phpclass Proxy{    private function __get($name) {}tx0 reports: __get must be public    public static function __call($name, $args) {}tx0 reports: __call cannot be static    public function __callStatic($name, $args) {}tx0 reports: __callStatic must be static    public function __set($name) {}tx0 reports: __set takes 2 parameters, not 1    public function __clone() {}    public function __isset($name) {}    public function __toString(): string { return ''; }}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:

tx0.toml
[rules]
"tx0/php:magic-method-signature" = "off"

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:magic-method-signature] reason="..."

tx0 explain tx0/php:magic-method-signature shows the same in the terminal. Found a false positive? Report it.