coding-standards-php
coding-standards-php copied to clipboard
Switch Acquia PHP to PSR12
This is a ground-up rewrite of the Acquia PHP standard to be based on PSR-12 and compatible with Drupal standards. In other words, any code adhering to Acquia PHP will also adhere to Drupal standards, but not necessarily vice-versa.
This means that Acquia PHP is a stricter subset of PSR-12 and the Drupal standards, which is a paradigm shift from its original implementation as a looser standard (and hence, base of) the Drupal standards. This warrants a new major release.
PER isn't available in PHPCS yet, but the good news is it's mostly backwards-compatible (i.e., only contains additions for new PHP features) and can we can basically swap it in for PSR-12 when it lands: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/29
The best way to test this is against projects already on the latest version of the AcquiaPHP or AcquiaDrupal* standards.
- For AcquiaDrupal* projects, see that nothing changes. If anything, the standards might be a little looser now.
- For AcquiaPHP projects, see that the standard is slightly more strict and incorporates PSR-12 elements.
Dependency changes
| Production Changes | From | To | Compare |
|---|---|---|---|
| drupal/coder | 8.3.18 | 8.3.23 | ... |
| phpstan/phpdoc-parser | 1.20.4 | 1.27.0 | ... |
| sirbrillig/phpcs-variable-analysis | v2.11.16 | v2.11.17 | ... |
| slevomat/coding-standard | 8.12.1 | 8.15.0 | ... |
| squizlabs/php_codesniffer | 3.7.2 | 3.9.0 | ... |
| symfony/polyfill-ctype | v1.27.0 | v1.29.0 | ... |
| symfony/yaml | v6.2.10 | v6.4.3 | ... |
| symfony/deprecation-contracts | NEW | v3.4.0 |