From a31d9a1679488a7e60b99b0a9901a4fca1aaf78c Mon Sep 17 00:00:00 2001 From: Will Pillar Date: Wed, 6 Apr 2016 16:01:21 +0100 Subject: [PATCH 1/2] Support PHP 5.5 --- .travis.yml | 1 + Makefile | 3 +++ composer.json | 4 ++-- src/AbstractFormatter.php | 3 +-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d7e818..ebb3092 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: php sudo: false php: + - 5.5 - 5.6 - 7.0 - hhvm diff --git a/Makefile b/Makefile index e09b99a..f793974 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ SHELL = /bin/sh .SILENT: help install: ## Download the depenedencies then build the image :rocket:. + docker pull php:5.5-cli docker pull php:5.6-cli docker pull php:7.0-cli make 'composer-update --optimize-autoloader --ignore-platform-reqs' @@ -21,6 +22,8 @@ test: ## Run the unit and intergration testsuites. test: test-unit test-benchmark test-unit: ## Run the unit testsuite. + docker run --rm -t -v $$(pwd):/opt/graze/formatter -w /opt/graze/formatter php:5.5-cli \ + vendor/bin/phpunit --testsuite unit docker run --rm -t -v $$(pwd):/opt/graze/formatter -w /opt/graze/formatter php:5.6-cli \ vendor/bin/phpunit --testsuite unit docker run --rm -t -v $$(pwd):/opt/graze/formatter -w /opt/graze/formatter php:7.0-cli \ diff --git a/composer.json b/composer.json index db24803..c01e09b 100644 --- a/composer.json +++ b/composer.json @@ -30,13 +30,13 @@ }, "require": { - "php": "^5.6 || ^7.0", + "php": "^5.5 || ^5.6 || ^7.0", "graze/sort": "^2.0.1" }, "require-dev": { "graze/hamcrest-test-listener": "^1.0", "hamcrest/hamcrest-php": "^1.2", - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^4.8" } } diff --git a/src/AbstractFormatter.php b/src/AbstractFormatter.php index 398ee0b..d268a83 100644 --- a/src/AbstractFormatter.php +++ b/src/AbstractFormatter.php @@ -13,7 +13,6 @@ namespace Graze\Formatter; -use function Graze\Sort\schwartzian; use Graze\Formatter\Filter; use Graze\Formatter\FormatterInterface; use Graze\Formatter\Processor; @@ -150,7 +149,7 @@ private function filter(array $unfiltered) private function sort(array $unsorted) { if ($this->sorters) { - return schwartzian($unsorted, $this->sorters); + return \Graze\Sort\schwartzian($unsorted, $this->sorters); } return $unsorted; From d96f9a446e6d1ceddeedff23b25d8d7250ed771f Mon Sep 17 00:00:00 2001 From: Will Pillar Date: Thu, 7 Apr 2016 09:44:58 +0100 Subject: [PATCH 2/2] Require PHPUnit 4.8 or 5.0 so PHP 5.6 users can use the latest --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c01e09b..dd5277b 100644 --- a/composer.json +++ b/composer.json @@ -37,6 +37,6 @@ "require-dev": { "graze/hamcrest-test-listener": "^1.0", "hamcrest/hamcrest-php": "^1.2", - "phpunit/phpunit": "^4.8" + "phpunit/phpunit": "^4.8 || ^5.0" } }