From 9b642f955b9d96578462570522d49fe35bb26c16 Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Mon, 21 Sep 2020 15:31:51 +0200 Subject: [PATCH 1/6] Support Laravel 6.0, because it's the current LTS version Reference: https://laravel.com/docs/8.x/releases#support-policy --- .travis.yml | 3 ++- composer.json | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b4d0c1c..c51f1fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ php: - 7.4 env: + - LARAVEL=^6.0 - LARAVEL=^7.0 - LARAVEL=^8.0 @@ -20,7 +21,7 @@ cache: install: - travis_retry composer install --no-suggest --no-interaction --prefer-dist --no-progress -script: +script: - ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml after_success: diff --git a/composer.json b/composer.json index 86cba21..528cea1 100644 --- a/composer.json +++ b/composer.json @@ -29,15 +29,15 @@ "php": ">=7.3", "guzzlehttp/guzzle": "^6.2", "aws/aws-sdk-php": "~3.0", - "illuminate/contracts": "^7.0|^8.0", - "illuminate/database": "^7.0|^8.0", - "illuminate/queue": "^7.0|^8.0", - "illuminate/console": "^7.0|^8.0", + "illuminate/contracts": "^6.0|^7.0|^8.0", + "illuminate/database": "^6.0|^7.0|^8.0", + "illuminate/queue": "^6.0|7.0|^8.0", + "illuminate/console": "^6.0|^7.0|^8.0", "twig/twig": "~3.0" }, "require-dev": { "phpunit/phpunit": "^8.5", - "mockery/mockery": "^1.2.1", + "mockery/mockery": "^1.4.2", "gecko-packages/gecko-memcache-mock": "^1.0" }, "extra": { From 519dd99fff341b1affa74da981a6cfa3744e8985 Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Thu, 24 Sep 2020 14:07:44 +0200 Subject: [PATCH 2/6] Use Illuminate\Support\Arr::get() instead of array_get() Because since Laravel 6, function helpers are not included in Laravel by default. Source: https://laravel.com/docs/6.x/upgrade#helpers --- src/Support/HealthzServiceProvider.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Support/HealthzServiceProvider.php b/src/Support/HealthzServiceProvider.php index 4659023..aea69e6 100644 --- a/src/Support/HealthzServiceProvider.php +++ b/src/Support/HealthzServiceProvider.php @@ -2,6 +2,7 @@ namespace Gentux\Healthz\Support; use Gentux\Healthz\Healthz; +use Illuminate\Support\Arr; use Illuminate\Support\ServiceProvider; class HealthzServiceProvider extends ServiceProvider @@ -51,8 +52,8 @@ protected function healthzUIHandler() $password = getenv('HEALTHZ_PASSWORD'); if ($username != "") { if ( - array_get($_SERVER, 'PHP_AUTH_USER') !== $username || - array_get($_SERVER, 'PHP_AUTH_PW') !== $password + Arr::get($_SERVER, 'PHP_AUTH_USER') !== $username || + Arr::get($_SERVER, 'PHP_AUTH_PW') !== $password ) { return response('Invalid credentials', 401, ['WWW-Authenticate' => 'Basic']); } From 4ddb7a5e457193da934711c433d36ca40f4c1dbb Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Thu, 24 Sep 2020 17:03:54 +0200 Subject: [PATCH 3/6] HealthResult::description(), which proxy the HealthCheck::description() method, must have the same return signature --- src/HealthResult.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HealthResult.php b/src/HealthResult.php index c2bca4c..c1f402d 100644 --- a/src/HealthResult.php +++ b/src/HealthResult.php @@ -71,9 +71,9 @@ public function title(): string } /** - * @return string + * @return null|string */ - public function description(): string + public function description(): ?string { return $this->check->description(); } From 824d8b4c8480d68b21fb4a598bc2fe0442388574 Mon Sep 17 00:00:00 2001 From: Payton Bice Date: Tue, 13 Oct 2020 11:43:54 -0500 Subject: [PATCH 4/6] Updates Guzzle and PHPUnit to support Laravel 8 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 86cba21..f4b4d81 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ }, "require": { "php": ">=7.3", - "guzzlehttp/guzzle": "^6.2", + "guzzlehttp/guzzle": "^7.0.1", "aws/aws-sdk-php": "~3.0", "illuminate/contracts": "^7.0|^8.0", "illuminate/database": "^7.0|^8.0", @@ -36,7 +36,7 @@ "twig/twig": "~3.0" }, "require-dev": { - "phpunit/phpunit": "^8.5", + "phpunit/phpunit": "^9.0", "mockery/mockery": "^1.2.1", "gecko-packages/gecko-memcache-mock": "^1.0" }, From 5eb509307eb77e243cde82a5b33c55ea8a9ac1a6 Mon Sep 17 00:00:00 2001 From: Payton Bice Date: Tue, 13 Oct 2020 12:10:19 -0500 Subject: [PATCH 5/6] Allow for dependents to optionally implement Laravel 8 This should maintain compatibility with earlier versions of Laravel, while still allowing some dependents to update to Laravel 8 without requiring us to release a new major version --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f4b4d81..269bfbc 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ }, "require": { "php": ">=7.3", - "guzzlehttp/guzzle": "^7.0.1", + "guzzlehttp/guzzle": "^6.2|^7.0.1", "aws/aws-sdk-php": "~3.0", "illuminate/contracts": "^7.0|^8.0", "illuminate/database": "^7.0|^8.0", @@ -36,7 +36,7 @@ "twig/twig": "~3.0" }, "require-dev": { - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^8.5|^9.0", "mockery/mockery": "^1.2.1", "gecko-packages/gecko-memcache-mock": "^1.0" }, From 4408ff9d5772b840323ff8fce1daf96c958c2afb Mon Sep 17 00:00:00 2001 From: Tortue Torche Date: Mon, 30 Nov 2020 12:10:34 +0100 Subject: [PATCH 6/6] PHP 7.2 and 8.0 support Because Laravel 6 (current LTS version) support PHP 7.2 --- .travis.yml | 10 ++++------ composer.json | 11 ++++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index c51f1fa..94975bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,23 @@ language: php php: + - 7.2 - 7.3 - 7.4 + - 8.0snapshot env: - LARAVEL=^6.0 - LARAVEL=^7.0 - LARAVEL=^8.0 -matrix: - fast_finish: true - allow_failures: - - php: 7.4 - cache: directories: - $HOME/.composer/cache install: - - travis_retry composer install --no-suggest --no-interaction --prefer-dist --no-progress + - travis_retry composer self-update + - travis_retry composer install --no-interaction --prefer-dist --no-progress script: - ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml diff --git a/composer.json b/composer.json index f529509..ec62106 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,8 @@ "email": "thomas.manley@generationtux.com" } ], - "minimum-stability": "stable", + "minimum-stability": "dev", + "prefer-stable": true, "autoload": { "psr-4": { "Gentux\\Healthz\\": "src/" @@ -26,8 +27,8 @@ ] }, "require": { - "php": ">=7.3", - "guzzlehttp/guzzle": "^6.2|^7.0.1", + "php": ">=7.2.5", + "guzzlehttp/guzzle": "^6.2", "aws/aws-sdk-php": "~3.0", "illuminate/contracts": "^6.0|^7.0|^8.0", "illuminate/database": "^6.0|^7.0|^8.0", @@ -36,8 +37,8 @@ "twig/twig": "~3.0" }, "require-dev": { - "phpunit/phpunit": "^8.5|^9.0", - "mockery/mockery": "^1.4.2", + "phpunit/phpunit": "^8.4|^9.3.3", + "mockery/mockery": "~1.3.3|^1.4.2", "gecko-packages/gecko-memcache-mock": "^1.0" }, "extra": {