Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.3 error mentioning php 8.1 as version #484

Open
MaximGns opened this issue Aug 5, 2024 · 5 comments
Open

PHP 8.3 error mentioning php 8.1 as version #484

MaximGns opened this issue Aug 5, 2024 · 5 comments
Assignees
Labels
bug Something isn't working Progress: PR created

Comments

@MaximGns
Copy link

MaximGns commented Aug 5, 2024

Preconditions

1.magento/product-enterprise-edition: "2.4.7-p1"
2. magento/magento-coding-standard: "33"
3. Previous coding standard version --> 31

PHP 8.3.9 (cli) (built: Jul  2 2024 14:10:14) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.9, Copyright (c), by Zend Technologies
FILE: ...ta/******.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 9 | ERROR | Readonly classes are not supported in PHP 8.1 or earlier.
   |       | (PHPCompatibility.Classes.NewReadonlyClasses.Found)
--------------------------------------------------------------------------------

@MaximGns MaximGns added the bug Something isn't working label Aug 5, 2024
Copy link

m2-assistant bot commented Aug 5, 2024

Hi @MaximGns. 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.

@fredden
Copy link
Member

fredden commented Aug 5, 2024

@MaximGns
Copy link
Author

MaximGns commented Aug 7, 2024

@fredden How to resolve this issue when using GrumPHP?

@fredden
Copy link
Member

fredden commented Aug 7, 2024

@MaximGns There are instructions on the PHPCompatibility repository for how to set testVersion via command line and/or in a custom ruleset. I've not tested with two custom rulesets both setting the value to see what comes out. You should be able to run phpcs --standard=Magento2 --runtime-set testVersion 8.3 ... to tell PHPCompatibility that you want to validate your code against PHP version 8.3 instead of the version(s) listed within the Magento2 ruleset.

@MaximGns
Copy link
Author

MaximGns commented Aug 8, 2024

@fredden thanks for explenation, but why not support 8.3 out of the box as magento itself also supports? why only php 8.1/8.2...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Progress: PR created
Projects
Status: Ready for Grooming
Development

No branches or pull requests

2 participants