diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33d19de..0618411 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,9 @@ name: Test -on: [ pull_request, push ] +on: + pull_request: + push: + branches: [ master ] jobs: test: @@ -11,11 +14,11 @@ jobs: fail-fast: false matrix: coverage: [ 'none' ] - php-versions: [ '7.4', '8.0', '8.1' ] + php-versions: [ '8.0', '8.1', '8.2' ] exclude: - - php-versions: '8.1' + - php-versions: '8.2' include: - - php-versions: '8.1' + - php-versions: '8.2' coverage: 'xdebug' name: PHP ${{ matrix.php-versions }} diff --git a/composer.json b/composer.json index 14207a4..8427d7f 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.0", "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0", "laravel/socialite": "~5.0" }, diff --git a/src/Helpers/ConfigRetriever.php b/src/Helpers/ConfigRetriever.php index c68d841..e978767 100644 --- a/src/Helpers/ConfigRetriever.php +++ b/src/Helpers/ConfigRetriever.php @@ -45,9 +45,7 @@ public function fromServices($providerName, array $additionalConfigKeys = []) $this->getFromServices('client_id'), $this->getFromServices('client_secret'), $this->getFromServices('redirect'), - $this->getConfigItems($additionalConfigKeys, function ($key) { - return $this->getFromServices(strtolower($key)); - }) + $this->getConfigItems($additionalConfigKeys, fn($key) => $this->getFromServices(strtolower($key))) ); } diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index c957804..1d1b1dc 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -40,9 +40,7 @@ public function register() } if (! $this->app->bound(ConfigRetrieverInterface::class)) { - $this->app->singleton(ConfigRetrieverInterface::class, function () { - return new ConfigRetriever(); - }); + $this->app->singleton(ConfigRetrieverInterface::class, fn() => new ConfigRetriever()); } } } diff --git a/src/SocialiteWasCalled.php b/src/SocialiteWasCalled.php index adec7d9..9ade289 100644 --- a/src/SocialiteWasCalled.php +++ b/src/SocialiteWasCalled.php @@ -20,10 +20,7 @@ class SocialiteWasCalled */ protected $app; - /** - * @var \SocialiteProviders\Manager\Contracts\Helpers\ConfigRetrieverInterface - */ - private $configRetriever; + private ConfigRetrieverInterface $configRetriever; /** * @param \Illuminate\Contracts\Container\Container $app diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 2b2df29..70e36ef 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -54,9 +54,7 @@ public function it_allows_closure_config_redirect() $key = 'key'; $secret = 'secret'; $callbackUri = 'uri'; - $callbackFunc = function () use ($callbackUri) { - return $callbackUri; - }; + $callbackFunc = fn() => $callbackUri; $result = [ 'client_id' => $key, 'client_secret' => $secret,