PHP 5.3: new ForbiddenToStringParameters sniff (part 2) by jrfnl · Pull Request #830 · PHPCompatibility/PHPCompatibility

@jrfnl

> The __toString() magic method can no longer accept arguments.

Ref: https://www.php.net/manual/en/migration53.incompatible.php

This introduces a sister-sniff called `PHPCompatibility.MethodUse.ForbiddenToStringParameters` to the `PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters` which will detect parameters being passed in direct calls to the magic `__toString()` method. (as per my previous remark in 815)

wimg

wimg approved these changes Jun 26, 2019

@wimg wimg deleted the php-5.3/new-methoduse-forbiddentostringparameters-sniff branch

June 26, 2019 20:46