From 7c45fb60dfa68fd5c5e241e03dad352b5a78c3b3 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Thu, 10 Dec 2020 15:19:01 +0100 Subject: [PATCH 1/3] Support Laravel 8 --- .travis.yml | 1 + CHANGELOG.md | 6 ++++++ composer.json | 8 ++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5178ff9..f8f8850 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - 7.2 - 7.3 - 7.4 +- 8 install: - composer install --prefer-dist --no-interaction --no-suggest diff --git a/CHANGELOG.md b/CHANGELOG.md index 036b614..864b4e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## 2.2.0 + +### Added + +- Support Laravel 8 + ## 2.1.0 ### Changed diff --git a/composer.json b/composer.json index 3136474..3752c43 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,12 @@ } ], "require": { - "php": "^7.2", - "illuminate/contracts": "5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0" + "php": "^7.2 || ^8", + "illuminate/contracts": "5.6.* || 5.7.* || 5.8.* || ^6 || ^7 || ^8" }, "require-dev": { - "orchestra/database": "3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4.0 || ^5.0", - "orchestra/testbench": "3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4.0 || ^5.0", + "orchestra/database": "3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4 || ^5 || ^6", + "orchestra/testbench": "3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4 || ^5 || ^6", "nunomaduro/larastan": "^0.4 || ^0.5" }, "autoload": { From 299b98ab8de2f7749905e7f013c68547dc4d27a4 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Thu, 10 Dec 2020 15:27:22 +0100 Subject: [PATCH 2/3] php 8.0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f8f8850..fff6e4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ php: - 7.2 - 7.3 - 7.4 -- 8 +- 8.0 install: - composer install --prefer-dist --no-interaction --no-suggest From a1711e175cb5a3be17085d4970311275d6a863f5 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Thu, 10 Dec 2020 15:28:38 +0100 Subject: [PATCH 3/3] Maximize phpstan --- composer.json | 2 +- phpstan.neon | 2 +- src/LaravelQueryLogServiceProvider.php | 15 +++++---------- tests/TestCase.php | 5 ++++- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 3752c43..9473fe4 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require-dev": { "orchestra/database": "3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4 || ^5 || ^6", "orchestra/testbench": "3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4 || ^5 || ^6", - "nunomaduro/larastan": "^0.4 || ^0.5" + "nunomaduro/larastan": "^0.4 || ^0.5 || ^0.6" }, "autoload": { "psr-4": { diff --git a/phpstan.neon b/phpstan.neon index a2cc47c..72060bf 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,7 @@ includes: - ./vendor/nunomaduro/larastan/extension.neon parameters: - level: 5 + level: max paths: - src - tests diff --git a/src/LaravelQueryLogServiceProvider.php b/src/LaravelQueryLogServiceProvider.php index 2c56b38..82302e8 100644 --- a/src/LaravelQueryLogServiceProvider.php +++ b/src/LaravelQueryLogServiceProvider.php @@ -15,13 +15,11 @@ class LaravelQueryLogServiceProvider extends ServiceProvider { - /** - * Bootstrap any application services. - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - public function boot(DatabaseManager $databaseManager, LogManager $logManager, ConfigRepository $configRepository): void - { + public function boot( + DatabaseManager $databaseManager, + LogManager $logManager, + ConfigRepository $configRepository + ): void { $this->publishes([ __DIR__.'/query-log.php' => $this->app->make('path.config').'/query-log.php', ], 'query-log-config'); @@ -55,9 +53,6 @@ protected function createDefaultLogger(): LoggerInterface ); } - /** - * Register any application services. - */ public function register(): void { $this->mergeConfigFrom(__DIR__.'/query-log.php', 'query-log'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 900eb87..cbd17d1 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -9,7 +9,10 @@ abstract class TestCase extends OrchestraTestCase { - protected function getPackageProviders($app) + /** + * @return array> + */ + protected function getPackageProviders($app): array { return [ LaravelQueryLogServiceProvider::class,