Skip to content

Commit a4a60cf

Browse files
author
Shawn Hooper
committed
Add PHP 7.3 compatibility checks (only available if server is running PHP >= 5.3)
1 parent 7547b34 commit a4a60cf

File tree

4 files changed

+115
-49
lines changed

4 files changed

+115
-49
lines changed

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"email": "[email protected]"
88
}],
99
"require": {
10-
"squizlabs/php_codesniffer": "^2.9.1",
10+
"squizlabs/php_codesniffer": "^2.9.2",
1111
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
12-
"phpcompatibility/phpcompatibility-wp": "^1"
12+
"phpcompatibility/phpcompatibility-wp": "^2"
1313
},
1414
"require-dev": {
15-
"wp-coding-standards/wpcs": "dev-master"
15+
"wp-coding-standards/wpcs": "^1"
1616
},
1717
"scripts": {
1818
"post-update-cmd": [

composer.lock

+98-37
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

php52/composer.lock

+9-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wpengine-phpcompat.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,17 @@ public static function init() {
109109
* @return array Associative array of available PHP versions.
110110
*/
111111
function get_phpversions() {
112+
112113
$versions = array(
113-
'PHP 7.3' => '7.3',
114114
'PHP 7.2' => '7.2',
115115
'PHP 7.1' => '7.1',
116116
'PHP 7.0' => '7.0',
117117
);
118118

119+
if ( version_compare( phpversion(), '5.3', '>=' ) ) {
120+
$versions = array( 'PHP 7.3' => '7.3') + $versions;
121+
}
122+
119123
$old_versions = array( '5.6', '5.5', '5.4', '5.3' );
120124

121125
while ( ! empty( $old_versions ) ) {

0 commit comments

Comments
 (0)