magento/magento-coding-standard

PHPCompatibility should check for PHP 8.3 and 8.4 compatibility

Opened this issue · 4 comments

Description

We currently only check for PHP 8.1 and 8.2 compatibility, which is pretty outdated. Especially now that Magento 2.4.8 will be released soon and will only support PHP 8.3 and 8.4

Expected behavior

Detect potential problems with PHP 8.3 and 8.4 in code scanned with this tool

Benefits

Finding problems in Magento core codebase and pull requests before they are released, using static analysis.

Additional information

I see 2 problems:

  • The Magento fork https://github.com/magento/PHPCompatibilityFork is very outdated, I really don't know why we can't use the original tool: https://github.com/PHPCompatibility/PHPCompatibility (yes, it hasn't had a stable version for many years, but using dev-develop as composer requirement works very good in my experience)
  • We currently have the PHPCompatibility testVersion setup to only scan for PHP 8.1 and 8.2 versions, see:
    <config name="testVersion" value="8.1-8.2"/>

    Changing this line probably won't help as the first bullet point points out that the Magento fork of this ruleset is very outdated and probably doesn't contain many checks against PHP 8.3/8.4 in contrast to the upstream version

Hi @hostep. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

Related: #487

I would love to see either the fork being updated or the fork not needing to be used anymore. I have checked the changes PHPCompatibility/PHPCompatibility@develop...magento:PHPCompatibilityFork:develop and I am not too sure if it would not be possible to update or add sniffs in another way via this module instead of having to add them to a fork that does not get updated.

Maybe @bubasuma can leave his thoughts here about this request? And can explain why we need this fork from Magento and if we can switch back to the original one or bring the fork more up2date?