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

Update magento2 codebase to be compatible with PHP 8 #31081

Closed
sivaschenko opened this issue Nov 27, 2020 · 10 comments
Closed

Update magento2 codebase to be compatible with PHP 8 #31081

sivaschenko opened this issue Nov 27, 2020 · 10 comments
Assignees
Labels
Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Project: Platform Health

Comments

@sivaschenko
Copy link
Member

sivaschenko commented Nov 27, 2020

Description 

Add PHP 8 compatibility to Magento 2

What should be done

  1. Fix the areas not yet covered by PHPCompatibility on develop branch:
    Account for changes introduced in PHP 8.0 PHPCompatibility/PHPCompatibility#809
  2. Update PHP version in composer.json from "7.3.0||7.4.0" to "7.4.0||8.0.0"
  3. Fix failed tests with PHP 8

Apply fro the following repos:

 

@sivaschenko sivaschenko added feature request Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Project: PHP8 labels Nov 27, 2020
@sivaschenko sivaschenko added this to the 2.5 milestone Nov 27, 2020
@m2-assistant
Copy link

m2-assistant bot commented Nov 27, 2020

Hi @sivaschenko. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@jamescowie
Copy link

Going to use this ticket as the tracker for what issues I faced and resolved.

Currently working on resolveArgument with $enforcedArguments being the wrong type. Within ClassReader reflection resolved the deprecated code of getType with getName

@jamescowie
Copy link

For composer and package manager we need to upgrade "laminas/laminas-mvc": "3.1.*", however that version conflicts which then stops installation of additional packages

@sivaschenko
Copy link
Member Author

sivaschenko commented Dec 16, 2020

@jamescowie great idea, It could be really helpful if you share the issues you faced, however, it could be even more helpful if these issues could be described in a bit more details. Unfortunately, I don't really understand which resolveArgument and $enforcedArguments you are talking about.

Also, this issue is related to the Magento codebase only, there are separate issues created for dependencies versions

@sergeynezbritskiy
Copy link
Contributor

@sivaschenko I've ran the next command vendor/bin/phpcs -p --standard=PhpCompatibility --extensions=php,phtml --ignore=./vendor/* .
Here is the list of issues, I've found:
report.txt
There are tones of PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound: Possible use of ASP style opening tags detected. ASP style opening tags have been removed in PHP 7.0. Found errors which make report very noisy. I'm going to disable that rule for reported files and generate a new much more clear report

@sergeynezbritskiy
Copy link
Contributor

sergeynezbritskiy commented Jan 31, 2021

After applying the PR #31913 the report is much more clear:
report.txt

@sivaschenko
Copy link
Member Author

Thanks for the report @sergeynezbritskiy ! Added to the description

@m2-community-project m2-community-project bot added the Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. label Feb 2, 2021
@sivaschenko sivaschenko removed the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Feb 3, 2021
@m2-assistant
Copy link

m2-assistant bot commented Aug 20, 2021

Hi @andrewbess. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Project: Platform Health
Projects
None yet
Development

No branches or pull requests

8 participants