Skip to content

Commit

Permalink
Stop supporting PHP < 8.0 (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot authored Aug 27, 2023
1 parent 47402cb commit df5e45b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test

on: [ pull_request, push ]
on:
pull_request:
push:
branches: [ master ]

jobs:
test:
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
4 changes: 1 addition & 3 deletions src/Helpers/ConfigRetriever.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
);
}

Expand Down
4 changes: 1 addition & 3 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
5 changes: 1 addition & 4 deletions src/SocialiteWasCalled.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit df5e45b

Please sign in to comment.