ReservedFunctionNames: ignore deprecated methods by design
Functions and methods should not use a double underscore prefix in the function name as all functions and methods with that prefix are reserved by PHP Core.
When a (public/protected) method/function is renamed, however, it breaks backward-compatibility, so it is common to deprecate the old method name and add a new method with a name which does comply.
I'm proposing that if a function/method is marked as deprecated in the function docblock, that the sniff should not throw an error.
class Example { public function newName() { } /** * @deprecated x.x.x Use Example::new_Name() instead. */ public function __oldName() { return self::newName(); } }
Currently the sniff would throw an error for the __oldName() method. Once this enhancement has been implemented, it no longer should.