From bae14a7ddfff3c6269979ab56cc8799facadacf6 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 18 Nov 2017 08:32:06 +0200 Subject: [PATCH 01/26] Test agains symfony versions --- .travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index da82445..4ac9d5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,9 +29,16 @@ matrix: include: - php: 5.4 env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" - + - php: 7.0 + env: SYMFONY_VERSION=v2 + - php: 7.1 + env: SYMFONY_VERSION=v3 + - php: 7.1 + env: SYMFONY_VERSION=dev-master + before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi + - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/lts:${SYMFONY_VERSION}" --no-update; fi; install: # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 From 1cb572bfc1f55040e981dddb8604549ecd5cfda4 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 18 Nov 2017 08:37:32 +0200 Subject: [PATCH 02/26] cs fixes --- src/Plugin/AddHostPlugin.php | 4 ++-- src/Plugin/AddPathPlugin.php | 4 ++-- src/Plugin/ContentTypePlugin.php | 2 +- src/Plugin/CookiePlugin.php | 2 +- src/Plugin/DecoderPlugin.php | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Plugin/AddHostPlugin.php b/src/Plugin/AddHostPlugin.php index 9e35de2..29ab8ae 100644 --- a/src/Plugin/AddHostPlugin.php +++ b/src/Plugin/AddHostPlugin.php @@ -33,7 +33,7 @@ final class AddHostPlugin implements Plugin */ public function __construct(UriInterface $host, array $config = []) { - if ($host->getHost() === '') { + if ('' === $host->getHost()) { throw new \LogicException('Host can not be empty'); } @@ -51,7 +51,7 @@ public function __construct(UriInterface $host, array $config = []) */ public function handleRequest(RequestInterface $request, callable $next, callable $first) { - if ($this->replace || $request->getUri()->getHost() === '') { + if ($this->replace || '' === $request->getUri()->getHost()) { $uri = $request->getUri() ->withHost($this->host->getHost()) ->withScheme($this->host->getScheme()) diff --git a/src/Plugin/AddPathPlugin.php b/src/Plugin/AddPathPlugin.php index 18fdf52..e24d61a 100644 --- a/src/Plugin/AddPathPlugin.php +++ b/src/Plugin/AddPathPlugin.php @@ -23,11 +23,11 @@ final class AddPathPlugin implements Plugin */ public function __construct(UriInterface $uri) { - if ($uri->getPath() === '') { + if ('' === $uri->getPath()) { throw new \LogicException('URI path cannot be empty'); } - if (substr($uri->getPath(), -1) === '/') { + if ('/' === substr($uri->getPath(), -1)) { throw new \LogicException('URI path cannot end with a slash.'); } diff --git a/src/Plugin/ContentTypePlugin.php b/src/Plugin/ContentTypePlugin.php index 038b3e4..2390ca6 100644 --- a/src/Plugin/ContentTypePlugin.php +++ b/src/Plugin/ContentTypePlugin.php @@ -102,7 +102,7 @@ private function isJson($stream) json_decode($stream->getContents()); - return json_last_error() == JSON_ERROR_NONE; + return JSON_ERROR_NONE == json_last_error(); } /** diff --git a/src/Plugin/CookiePlugin.php b/src/Plugin/CookiePlugin.php index c6cd36f..59ee90d 100644 --- a/src/Plugin/CookiePlugin.php +++ b/src/Plugin/CookiePlugin.php @@ -51,7 +51,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl continue; } - if ($cookie->isSecure() && ($request->getUri()->getScheme() !== 'https')) { + if ($cookie->isSecure() && ('https' !== $request->getUri()->getScheme())) { continue; } diff --git a/src/Plugin/DecoderPlugin.php b/src/Plugin/DecoderPlugin.php index 7666c64..4b924a4 100644 --- a/src/Plugin/DecoderPlugin.php +++ b/src/Plugin/DecoderPlugin.php @@ -123,15 +123,15 @@ private function decodeOnEncodingHeader($headerName, ResponseInterface $response */ private function decorateStream($encoding, StreamInterface $stream) { - if (strtolower($encoding) == 'chunked') { + if ('chunked' == strtolower($encoding)) { return new Encoding\DechunkStream($stream); } - if (strtolower($encoding) == 'deflate') { + if ('deflate' == strtolower($encoding)) { return new Encoding\DecompressStream($stream); } - if (strtolower($encoding) == 'gzip') { + if ('gzip' == strtolower($encoding)) { return new Encoding\GzipDecodeStream($stream); } From f1cb956124f77c4022dfff5ca156660e829f8cd3 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 18 Nov 2017 18:22:43 +0200 Subject: [PATCH 03/26] Improve travis tests --- .travis.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4ac9d5b..88dda67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,14 +8,6 @@ cache: directories: - $HOME/.composer/cache/files -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - hhvm - env: global: - TEST_COMMAND="composer test" @@ -27,18 +19,16 @@ branches: matrix: fast_finish: true include: - - php: 5.4 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" - - php: 7.0 - env: SYMFONY_VERSION=v2 - - php: 7.1 - env: SYMFONY_VERSION=v3 + - php: 5.4 # Min supported PHP version + env: DEPENDENCIES="minimun" COVERAGE=true TEST_COMMAND="composer test-ci" + - php: 7.1 # Latest PHP version + env: DEPENDENCIES="beta" - php: 7.1 - env: SYMFONY_VERSION=dev-master before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - - if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/lts:${SYMFONY_VERSION}" --no-update; fi; + - if [ "$DEPENDENCIES" = "minimun" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; + - if [ "$DEPENDENCIES" = "beta" ]; then COMPOSER_FLAGS="--minimum-stability=beta"; fi; install: # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 From 2f59b40bd7be667c670f4cefa0541fdf21a22f91 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 18 Nov 2017 18:26:23 +0200 Subject: [PATCH 04/26] Allow failures on BETA --- .travis.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88dda67..f81239c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,11 +19,21 @@ branches: matrix: fast_finish: true include: - - php: 5.4 # Min supported PHP version + # Minimum supported PHP and Symfony version + - php: 5.4 env: DEPENDENCIES="minimun" COVERAGE=true TEST_COMMAND="composer test-ci" - - php: 7.1 # Latest PHP version + + # Latest releases + - php: 7.1 + + # Latest beta releases + - php: 7.1 env: DEPENDENCIES="beta" + + allow_failures: + # Latest beta is allowed to fail. - php: 7.1 + env: DEPENDENCIES="beta" before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi From 092d8321902d4571aa4cc51cbedf79352f3769ff Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 18 Nov 2017 18:28:07 +0200 Subject: [PATCH 05/26] typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f81239c..49b7deb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ matrix: before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - if [ "$DEPENDENCIES" = "minimun" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; - - if [ "$DEPENDENCIES" = "beta" ]; then COMPOSER_FLAGS="--minimum-stability=beta"; fi; + - if [ "$DEPENDENCIES" = "beta" ]; then COMPOSER_FLAGS="--stability beta"; fi; install: # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 From 37d369878d85e6d5c240890b22cac114822a6983 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 18 Nov 2017 22:23:11 +0200 Subject: [PATCH 06/26] Test LTS releases --- .travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 49b7deb..86e9907 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,9 +23,15 @@ matrix: - php: 5.4 env: DEPENDENCIES="minimun" COVERAGE=true TEST_COMMAND="composer test-ci" - # Latest releases + # Test the latest stable release - php: 7.1 + # Test LTS versions + - php: 7.1 + env: DEPENDENCIES="symfony/lts:2" + - php: 7.1 + env: DEPENDENCIES="symfony/lts:3" + # Latest beta releases - php: 7.1 env: DEPENDENCIES="beta" @@ -39,6 +45,7 @@ before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - if [ "$DEPENDENCIES" = "minimun" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; - if [ "$DEPENDENCIES" = "beta" ]; then COMPOSER_FLAGS="--stability beta"; fi; + - if [ ! -z "$DEPENDENCIES" ]; then composer require --no-update $DEPENDENCIES; fi; install: # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 From 7920c09800b205a9732a11d776dd37b8496ad08f Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 18 Nov 2017 22:26:36 +0200 Subject: [PATCH 07/26] typos --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 86e9907..9abb431 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,9 +28,9 @@ matrix: # Test LTS versions - php: 7.1 - env: DEPENDENCIES="symfony/lts:2" + env: DEPENDENCIES="symfony/lts:v2" - php: 7.1 - env: DEPENDENCIES="symfony/lts:3" + env: DEPENDENCIES="symfony/lts:v3" # Latest beta releases - php: 7.1 @@ -44,7 +44,7 @@ matrix: before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - if [ "$DEPENDENCIES" = "minimun" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; - - if [ "$DEPENDENCIES" = "beta" ]; then COMPOSER_FLAGS="--stability beta"; fi; + - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - if [ ! -z "$DEPENDENCIES" ]; then composer require --no-update $DEPENDENCIES; fi; install: From f066efbe2887e799427afce011771d511fd31b5d Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 18 Nov 2017 22:28:15 +0200 Subject: [PATCH 08/26] Check if string contains slash --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9abb431..8f99153 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - if [ "$DEPENDENCIES" = "minimun" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - - if [ ! -z "$DEPENDENCIES" ]; then composer require --no-update $DEPENDENCIES; fi; + - if [[ $DEPENDENCIES == *"/"* ]]; then composer require --no-update $DEPENDENCIES; fi; install: # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 From 14df844c17592b5acda30c098eddf11e1d076d76 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 18 Nov 2017 22:31:36 +0200 Subject: [PATCH 09/26] Remove Symfony4.0 to see how travis behaves --- .travis.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8f99153..bdcbeaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ matrix: - php: 7.1 env: DEPENDENCIES="symfony/lts:v3" - # Latest beta releases + # Latest beta release - php: 7.1 env: DEPENDENCIES="beta" diff --git a/composer.json b/composer.json index c2c9ec4..7b21059 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php-http/httplug": "^1.1", "php-http/message-factory": "^1.0", "php-http/message": "^1.6", - "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + "symfony/options-resolver": "^2.6 || ^3.0" }, "require-dev": { "phpspec/phpspec": "^2.4", From 8a5122aa895f59808e9002785bb1c59507a191c0 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 19 Nov 2017 14:08:15 +0200 Subject: [PATCH 10/26] Make the PR ready for merge --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7b21059..ce1c2b0 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,11 @@ } ], "require": { - "php": ">=5.4", + "php": "^5.4 || ^7.0", "php-http/httplug": "^1.1", "php-http/message-factory": "^1.0", "php-http/message": "^1.6", - "symfony/options-resolver": "^2.6 || ^3.0" + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" }, "require-dev": { "phpspec/phpspec": "^2.4", From 566ad7fdcf15ed17c4016ad5729f589e35aa4dbb Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 19 Nov 2017 14:22:02 +0200 Subject: [PATCH 11/26] typo --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bdcbeaa..27d2203 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: include: # Minimum supported PHP and Symfony version - php: 5.4 - env: DEPENDENCIES="minimun" COVERAGE=true TEST_COMMAND="composer test-ci" + env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" # Test the latest stable release - php: 7.1 @@ -43,7 +43,7 @@ matrix: before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - - if [ "$DEPENDENCIES" = "minimun" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; + - if [ "$DEPENDENCIES" = "minimum" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; - if [[ $DEPENDENCIES == *"/"* ]]; then composer require --no-update $DEPENDENCIES; fi; From 24ed526f19d7b832e32162e0d4a4379a5814a28f Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 10:02:40 +0100 Subject: [PATCH 12/26] Updated according to feedback --- .travis.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27d2203..878679f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,31 +20,34 @@ matrix: fast_finish: true include: # Minimum supported PHP and Symfony version - - php: 5.4 + - php: 7.1 env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" # Test the latest stable release + - php: 5.6 + - php: 7.0 - php: 7.1 + - php: 7.2 # Test LTS versions - - php: 7.1 + - php: 5.4 env: DEPENDENCIES="symfony/lts:v2" - - php: 7.1 + - php: 5.5 env: DEPENDENCIES="symfony/lts:v3" - # Latest beta release + # Latest dev release - php: 7.1 - env: DEPENDENCIES="beta" + env: DEPENDENCIES="dev" allow_failures: # Latest beta is allowed to fail. - php: 7.1 - env: DEPENDENCIES="beta" + env: DEPENDENCIES="dev" before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - if [ "$DEPENDENCIES" = "minimum" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; - - if [ "$DEPENDENCIES" = "beta" ]; then composer config minimum-stability beta; fi; + - if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi; - if [[ $DEPENDENCIES == *"/"* ]]; then composer require --no-update $DEPENDENCIES; fi; install: @@ -53,6 +56,7 @@ install: - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction script: + - composer validate --strict --no-check-lock - $TEST_COMMAND after_success: From 5d04ded4d914933191fc281674e095b7e8ebbf44 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 25 Nov 2017 10:17:19 +0100 Subject: [PATCH 13/26] Use tilde --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 878679f..cada546 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,9 +31,9 @@ matrix: # Test LTS versions - php: 5.4 - env: DEPENDENCIES="symfony/lts:v2" + env: DEPENDENCIES="symfony/lts:^2" - php: 5.5 - env: DEPENDENCIES="symfony/lts:v3" + env: DEPENDENCIES="symfony/lts:^3" # Latest dev release - php: 7.1 From 2a71c9b305fbc8c527ec0f46777340646698038a Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 29 Nov 2017 20:44:58 +0100 Subject: [PATCH 14/26] Make sure tests passes --- .travis.yml | 5 ++--- composer.json | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index cada546..847d411 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,9 +19,8 @@ branches: matrix: fast_finish: true include: - # Minimum supported PHP and Symfony version - - php: 7.1 - env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" + - php: 5.5 + env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage^1.0" # Test the latest stable release - php: 5.6 diff --git a/composer.json b/composer.json index ce1c2b0..5bf7f29 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,7 @@ "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.4", - "henrikbjorn/phpspec-code-coverage" : "^1.0", + "phpspec/phpspec": "^2.4 || ^3.0 || ^4.0", "guzzlehttp/psr7": "^1.4" }, "suggest": { From 88594a1d16d44fc912b280388f5c100a8f61146d Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 29 Nov 2017 20:49:22 +0100 Subject: [PATCH 15/26] typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 847d411..07831a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ matrix: fast_finish: true include: - php: 5.5 - env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage^1.0" + env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage:^1.0" # Test the latest stable release - php: 5.6 From 901d830f6b6f99b70eadd62e31ab0e4f735a2440 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 29 Nov 2017 20:55:49 +0100 Subject: [PATCH 16/26] Do not run coverege on min-deps --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07831a5..8b3e987 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,14 +19,15 @@ branches: matrix: fast_finish: true include: - - php: 5.5 - env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage:^1.0" + - php: 7.1 + env: DEPENDENCIES="minimum" # Test the latest stable release - - php: 5.6 + - php: 5.5 - php: 7.0 - php: 7.1 - php: 7.2 + env: COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage:^1.0" # Test LTS versions - php: 5.4 From 73d4ede218a4cb6e3e53808d34745722679522ae Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 29 Nov 2017 22:02:54 +0100 Subject: [PATCH 17/26] Introduce stability variable --- .travis.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b3e987..0a4a706 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ matrix: fast_finish: true include: - php: 7.1 - env: DEPENDENCIES="minimum" + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" # Test the latest stable release - php: 5.5 @@ -37,18 +37,16 @@ matrix: # Latest dev release - php: 7.1 - env: DEPENDENCIES="dev" + env: STABILITY="dev" allow_failures: # Latest beta is allowed to fail. - - php: 7.1 - env: DEPENDENCIES="dev" + - env: STABILITY="dev" before_install: - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - - if [ "$DEPENDENCIES" = "minimum" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi; - - if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi; - - if [[ $DEPENDENCIES == *"/"* ]]; then composer require --no-update $DEPENDENCIES; fi; + - if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; + - if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; install: # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 From 921ddbaeaa9e2eeb2d699be571d4ddb3b93e9253 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 29 Nov 2017 22:03:09 +0100 Subject: [PATCH 18/26] typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0a4a706..a9d4c46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,7 @@ matrix: env: STABILITY="dev" allow_failures: - # Latest beta is allowed to fail. + # Latest dev is allowed to fail. - env: STABILITY="dev" before_install: From 518f86b0601adab71c686df5b98aa454e1257992 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 30 Nov 2017 11:05:37 +0100 Subject: [PATCH 19/26] Fixes --- .travis.yml | 6 ++++-- composer.json | 2 +- src/Plugin/ContentTypePlugin.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a9d4c46..4008b6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,9 +31,11 @@ matrix: # Test LTS versions - php: 5.4 - env: DEPENDENCIES="symfony/lts:^2" + env: DEPENDENCIES="dunglas/symfony-lock:^2" - php: 5.5 - env: DEPENDENCIES="symfony/lts:^3" + env: DEPENDENCIES="dunglas/symfony-lock:^3" + - php: 7.1 + env: DEPENDENCIES="dunglas/symfony-lock:^4" # Latest dev release - php: 7.1 diff --git a/composer.json b/composer.json index 5bf7f29..c5c0ca4 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.4 || ^3.0 || ^4.0", + "phpspec/phpspec": "^3.4 || ^4.2", "guzzlehttp/psr7": "^1.4" }, "suggest": { diff --git a/src/Plugin/ContentTypePlugin.php b/src/Plugin/ContentTypePlugin.php index 2390ca6..8ef1d62 100644 --- a/src/Plugin/ContentTypePlugin.php +++ b/src/Plugin/ContentTypePlugin.php @@ -102,7 +102,7 @@ private function isJson($stream) json_decode($stream->getContents()); - return JSON_ERROR_NONE == json_last_error(); + return JSON_ERROR_NONE === json_last_error(); } /** From e9e907345d23d1cacd8ac241c5041c40b987fe56 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 30 Nov 2017 11:07:55 +0100 Subject: [PATCH 20/26] Added back PHPSpec 2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c5c0ca4..fc5fc5f 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^3.4 || ^4.2", + "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2", "guzzlehttp/psr7": "^1.4" }, "suggest": { From 8d1403bc9bdfe908f8bbb79b8f3d00b53abd4169 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 30 Nov 2017 11:11:04 +0100 Subject: [PATCH 21/26] fixed PHP versions --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4008b6e..0a7d50a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,16 +23,18 @@ matrix: env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" # Test the latest stable release + - php: 5.4 - php: 5.5 + - php: 5.6 - php: 7.0 - php: 7.1 - php: 7.2 env: COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage:^1.0" # Test LTS versions - - php: 5.4 + - php: 7.1 env: DEPENDENCIES="dunglas/symfony-lock:^2" - - php: 5.5 + - php: 7.1 env: DEPENDENCIES="dunglas/symfony-lock:^3" - php: 7.1 env: DEPENDENCIES="dunglas/symfony-lock:^4" @@ -53,7 +55,7 @@ before_install: install: # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi - - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction + - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction script: - composer validate --strict --no-check-lock From 8c62d22ca5b347dcb47e396bd913d4dbea23b1de Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 30 Nov 2017 11:18:41 +0100 Subject: [PATCH 22/26] Fixed deps low --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0a7d50a..e7c4bc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ matrix: fast_finish: true include: - php: 7.1 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" DEPENDENCIES="doctrine/instanciator:^1.05" # Test the latest stable release - php: 5.4 From dcb2bca9fffbb4298449f04587f6d4048e6f1820 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 30 Nov 2017 11:20:56 +0100 Subject: [PATCH 23/26] Fixed typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e7c4bc4..293ea18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ matrix: fast_finish: true include: - php: 7.1 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" DEPENDENCIES="doctrine/instanciator:^1.05" + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" DEPENDENCIES="doctrine/instanciator:^1.0.5" # Test the latest stable release - php: 5.4 From 9d5c846ab5dabb146c48fbc06a513379d56df339 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 30 Nov 2017 11:29:06 +0100 Subject: [PATCH 24/26] Minor --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 293ea18..a6df19c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,8 @@ branches: matrix: fast_finish: true include: - - php: 7.1 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" DEPENDENCIES="doctrine/instanciator:^1.0.5" + - php: 7.0 + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" DEPENDENCIES="doctrine/instantiator:^1.1" # Test the latest stable release - php: 5.4 @@ -54,7 +54,7 @@ before_install: install: # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 - - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi + - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction script: From dc97863f3f67d01f445259280208e70b1818e613 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 30 Nov 2017 11:39:26 +0100 Subject: [PATCH 25/26] Test on rc --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a6df19c..c48be00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ matrix: - php: 7.1 env: DEPENDENCIES="dunglas/symfony-lock:^3" - php: 7.1 - env: DEPENDENCIES="dunglas/symfony-lock:^4" + env: DEPENDENCIES="dunglas/symfony-lock:^4" STABILITY="rc" # Latest dev release - php: 7.1 @@ -53,6 +53,7 @@ before_install: - if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; install: + - cat composer.json # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction From 03ca9ceb65d63b67ddfd6edafe64b129b0832be9 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 30 Nov 2017 11:43:18 +0100 Subject: [PATCH 26/26] PHP 7.1 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c48be00..6af5f34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ branches: matrix: fast_finish: true include: - - php: 7.0 + - php: 7.1 env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" DEPENDENCIES="doctrine/instantiator:^1.1" # Test the latest stable release