joomla / coding-standards

Joomla Coding Standards Definition
https://developer.joomla.org/coding-standards/basic-guidelines.html
GNU General Public License v2.0
128 stars 129 forks source link

Support new magic methods in PHP 7.4 #249

Open mbabker opened 5 years ago

mbabker commented 5 years ago

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.

photodude commented 5 years ago

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

zero-24 commented 5 years ago

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

mbabker commented 5 years ago

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.