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

Drop support for PHP 5.2 #96

Merged
merged 1 commit into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ matrix:
include:
- php: 7.4
env: PHPCS=1
- php: 5.2
dist: precise
- php: 5.3
dist: precise

Expand All @@ -37,19 +35,16 @@ before_install:
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'

install:
- if [[ $TRAVIS_PHP_VERSION == "5.2" || $TRAVIS_PHP_VERSION == "5.3" ]]; then phpenv local 5.3.29; fi
- if [[ $TRAVIS_PHP_VERSION == "5.2" || $TRAVIS_PHP_VERSION == "5.3" ]]; then composer remove --dev --no-update --no-scripts yoast/yoastcs; fi
- if [[ $TRAVIS_PHP_VERSION == "5.2" ]]; then composer remove --dev --no-update --no-scripts phpunit/phpunit; fi
- if [[ $TRAVIS_PHP_VERSION == "5.3" ]]; then phpenv local 5.3.29; fi
- if [[ $TRAVIS_PHP_VERSION == "5.3" ]]; then composer remove --dev --no-update --no-scripts yoast/yoastcs; fi
- if [[ $TRAVIS_PHP_VERSION != "nightly" ]]; then composer install --prefer-dist --no-interaction; fi
- if [[ $TRAVIS_PHP_VERSION == "5.2" || $TRAVIS_PHP_VERSION == "5.3" ]]; then phpenv local --unset; fi
- if [[ $TRAVIS_PHP_VERSION == "5.3" ]]; then phpenv local --unset; fi

script:
- echo $TRAVIS_PHP_VERSION
- find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
- |
if [[ "$TRAVIS_PHP_VERSION" == "5.2" ]]; then
phpunit
elif [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then
if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then
./vendor/bin/phpunit
fi
- if [[ "$TRAVIS_PHP_VERSION" == "5.3" || "$TRAVIS_PHP_VERSION" == "7.4" ]]; then composer validate --no-check-all; fi
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ A WordPress package to nudge users to upgrade their software versions (starting

The following versions of PHP are supported:

* PHP 5.2
* PHP 5.3
* PHP 5.4
* PHP 5.5
* PHP 5.6
* PHP 7.0
* PHP 7.1
* PHP 7.2
* PHP 7.3
* PHP 7.4

WordPress is also required for certain functionality:

Expand All @@ -35,7 +37,7 @@ whip_wp_check_versions( array(
) );
```

This will show a message to all users of your plugin on PHP5.2 to PHP 5.5. By default the message will be shown on every page of the admin and to every user. It is up to the implementing plugin to restrict this to certain users and/or pages.
This will show a message to all users of your plugin on PHP 5.3 to PHP 5.5. By default the message will be shown on every page of the admin and to every user. It is up to the implementing plugin to restrict this to certain users and/or pages.

### Adding a message as a host

Expand Down
16 changes: 3 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,22 @@
]
},
"require": {
"php": ">=5.2",
"xrstf/composer-php52": "^1.0"
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "^3.6.12 || ^4.5 || ^5.7 || ^6.0 || ^7.0",
"phpunit/phpunit": "^4.5 || ^5.7 || ^6.0 || ^7.0",
"roave/security-advisories": "dev-master",
"yoast/yoastcs": "^2.0.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-install-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"post-update-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"post-autoload-dump": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"config-yoastcs" : [
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run",
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --config-set default_standard Yoast"
],
"check-cs": [
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 5.2-"
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 5.3-"
],
"fix-cs": [
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf"
Expand Down
4 changes: 2 additions & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
class_alias( 'PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase' );
}

if ( file_exists( dirname( __FILE__ ) . '/../vendor/autoload_52.php' ) ) {
require_once dirname( __FILE__ ) . '/../vendor/autoload_52.php';
if ( file_exists( dirname( __FILE__ ) . '/../vendor/autoload.php' ) ) {
require_once dirname( __FILE__ ) . '/../vendor/autoload.php';
}
else {
echo 'ERROR: Run `composer install` to generate the autoload files before running the unit tests.' . PHP_EOL;
Expand Down