coding-standards icon indicating copy to clipboard operation
coding-standards copied to clipboard

Support new magic methods in PHP 7.4

Open mbabker opened this issue 6 years ago • 3 comments

PHP 7.4 introduces two new magic methods, __serialize and __unserialize. Introducing support for this has broken PHPCS on the relevant repos because the Joomla.NamingConventions.ValidFunctionName.MethodDoubleUnderscore sniff does not know about these new methods.

mbabker avatar Jul 06 '19 16:07 mbabker

Does the newer versions of PHPCS v3.4.x work with it?

photodude avatar Jul 22 '19 21:07 photodude

hmm should't we be able to extend the $this->magicMethods array ourself as workaround?

zero-24 avatar Jul 23 '19 16:07 zero-24

You'll have to for the Joomla Coding Standards 2.x ruleset at a minimum unless you basically say that will never be PHP 7.4 friendly (AFAIK PHP_CodeSniffer isn't supporting 2.x anymore). For 3.x, the minimum PHP_CodeSniffer version can be bumped to something that supports it when available.

mbabker avatar Jul 23 '19 17:07 mbabker