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

Bump minimum PHP version from 5.6 to 7.0 #7088

Merged
merged 10 commits into from
May 9, 2022
Merged
15 changes: 3 additions & 12 deletions .github/workflows/build-test-measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,12 @@ jobs:
- php: '7.0'
wp: '5.1'

- php: '5.6'
- php: '7.0'
wp: '5.0'

- php: '5.6'
- php: '7.0'
wp: '4.9'
external-http: true
install-pwa-plugin: false

steps:
# Note: The repeated `needs.pre-run.outputs.changed-php-count > 0` checks would be avoided if a step could short-
Expand Down Expand Up @@ -576,14 +575,6 @@ jobs:
wp: '5.1'
coverage: false

- php: '5.6'
wp: '5.0'
coverage: false

- php: '5.6'
wp: '4.9'
coverage: false

steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -703,7 +694,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '5.6'
php-version: '7.0'

- name: Setup Node
uses: actions/setup-node@v3.1.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ An easier path to great Page Experience for everyone. Powered by AMP.
**Tested up to:** 5.9
**Stable tag:** 2.2.4
**License:** [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)
**Requires PHP:** 5.6
**Requires PHP:** 7.0

[![Build Status](https://github.com/ampproject/amp-wp/workflows/Build,%20test%20&%20measure/badge.svg)](https://github.com/ampproject/amp-wp/actions?query=branch%3Adevelop+workflow%3A%22Build%2C+test+%26+measure%22)
[![Coverage Status](https://img.shields.io/codecov/c/github/ampproject/amp-wp/develop.svg)](https://codecov.io/gh/ampproject/amp-wp)
Expand Down
6 changes: 3 additions & 3 deletions amp.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Version: 2.3.0-alpha
* License: GPLv2 or later
* Requires at least: 4.9
* Requires PHP: 5.6
* Requires PHP: 7.0
*
* @package AMP
*/
Expand All @@ -28,13 +28,13 @@

$_amp_load_errors = new WP_Error();

if ( version_compare( phpversion(), '5.6', '<' ) ) {
if ( version_compare( phpversion(), '7.0', '<' ) ) {
$_amp_load_errors->add(
'insufficient_php_version',
sprintf(
/* translators: %s: required PHP version */
__( 'The AMP plugin requires PHP %s. Please contact your host to update your PHP version.', 'amp' ),
'5.6+'
'7.0+'
)
);
}
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "wordpress-plugin",
"homepage": "https://github.com/ampproject/amp-wp",
"require": {
"php": "^5.6 || ^7.0 || ^8.0",
"php": "^7.0 || ^8.0",
"ext-curl": "*",
"ext-date": "*",
"ext-dom": "*",
Expand Down Expand Up @@ -75,7 +75,7 @@
"dealerdirect/phpcodesniffer-composer-installer": true
},
"platform": {
"php": "5.6.20"
"php": "7.0.8"
},
"sort-packages": true
},
Expand All @@ -90,7 +90,8 @@
},
"patches": {
"phpunit/phpunit-mock-objects": {
"Fix ReflectionParameter warnings on PHP 8": "patches/phpunit-mock-objects.patch"
"Fix ReflectionParameter warnings on PHP 8": "patches/phpunit-mock-objects.patch",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this patch just need to be refreshed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or rather, I'm curious how you came up with this change: 4725407

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, We need to update that patch. Because previously it was used the ^3.2 version. and now it's using the ^5.0.9 version. But after 3.4.4 directory structure is changed ( see 4.0.0 ) So therefor we need to update patch file.

"Remove 'match' keyword from uses <https://github.com/sebastianbergmann/phpunit/issues/4373>": "patches/remove-match-keyword.patch"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding #7088 (comment), I'm curious how you were able to find the solution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added in 613eca commit. And for that, I took some references from here.

So it basically applies changes of this PR into an installed version of phpunit/phpunit-mock-objects package.

},
"sabberworm/php-css-parser": {
"1. Add additional validation for size unit <https://github.com/sabberworm/PHP-CSS-Parser/pull/350>": "https://github.com/westonruter/PHP-CSS-Parser/commit/5b1d6a4abe43f4311d9b4674913ca665ed8c43aa.diff",
Expand Down
Loading