magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Remove legacy compatibility code for PHP versions < 8.1

Open ihor-sviziev opened this issue 7 months ago • 14 comments

Description (*)

This pull request removes code that was designed to be ran on PHP <8.1. Also, removed checks for PHP_VERSION_ID contact availability, since it's available in all PHP versions

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • [ ] Pull request has a meaningful description of its purpose
  • [ ] All commits are accompanied by meaningful commit messages
  • [ ] All new or changed code is covered with unit/integration tests (if applicable)
  • [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • [ ] All automated tests passed successfully (all builds are green)

Resolved issues:

  1. [x] resolves magento/magento2#39891: Remove legacy compatibility code for PHP versions < 8.1

ihor-sviziev avatar May 01 '25 15:05 ihor-sviziev

Hi @ihor-sviziev. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment. :exclamation: Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s) For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.

m2-assistant[bot] avatar May 01 '25 15:05 m2-assistant[bot]

@magento run all tests

ihor-sviziev avatar May 01 '25 15:05 ihor-sviziev

@magento run all tests

ihor-sviziev avatar May 02 '25 08:05 ihor-sviziev

@magento create issue

engcom-Hotel avatar May 06 '25 11:05 engcom-Hotel

@magento run all tests

engcom-Hotel avatar Jun 06 '25 05:06 engcom-Hotel

@magento run Static Tests

ihor-sviziev avatar Jun 06 '25 11:06 ihor-sviziev

@magento run Static Tests

ihor-sviziev avatar Jun 06 '25 13:06 ihor-sviziev

@magento run all tests

engcom-Hotel avatar Jun 09 '25 06:06 engcom-Hotel

@magento run all tests

engcom-Dash avatar Jun 18 '25 08:06 engcom-Dash

@ihor-sviziev Thank you for the contribution & collaboration!

✔️ QA Passed

Testing is not required as the legacy code for PHP version < 8.0.0 has been removed in this PR. PHP_VERSION_ID is available in all the PHP versions hence we can safely remove the checks for it. Also, T_NAME_QUALIFIED & T_NAME_FULLY_QUALIFIED are available in versions starting from 8.0.0.

Build is failing hence moving this PR in Extended Testing.

engcom-Dash avatar Jun 18 '25 13:06 engcom-Dash

@magento run all tests

engcom-Dash avatar Jun 19 '25 05:06 engcom-Dash

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Unit Tests

engcom-Dash avatar Jun 19 '25 08:06 engcom-Dash

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Unit Tests

engcom-Dash avatar Jun 19 '25 12:06 engcom-Dash

@magento run all tests

engcom-Dash avatar Jun 20 '25 05:06 engcom-Dash

@magento run all tests

engcom-Dash avatar Jun 27 '25 06:06 engcom-Dash

@magento run Functional Tests B2B, Functional Tests CE, Unit Tests

engcom-Dash avatar Jun 27 '25 08:06 engcom-Dash

The Functional B2B failures in last two builds are inconsistent and seems to be flaky. They neither part of PR nor failing because of the PR changes.

Build 1: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39882/f35d10ebc5ee0f79c94924a9107d7f40/Functional/allure-report-b2b/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Build 2: https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/39882/36407606d4963b6a298bc72ba495e330/Functional/allure-report-b2b/index.html#categories/8fb3a91ba5aaf9de24cc8a92edc82b5d

image

Unit Tests are failing without any error. It is known Issue and JIRA has been raised for the same. https://jira.corp.adobe.com/browse/ACQP-5143

Hence moving this PR in Merge In Progress.

engcom-Dash avatar Jun 27 '25 11:06 engcom-Dash