Skip to content

Commit 61d4c2f

Browse files
committed
Drop support for Symfony < 5.1
1 parent 61b7e38 commit 61d4c2f

File tree

6 files changed

+5
-75
lines changed

6 files changed

+5
-75
lines changed

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
strategy:
1212
matrix:
1313
symfony-version:
14-
- "4.4.*"
1514
- "5.1.*"
1615
- "5.2.*"
1716
php-version:

.psalm.baseline.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
<ImplicitToStringCast occurrences="1">
55
<code>service(GrantConfigurator::class)</code>
66
</ImplicitToStringCast>
7-
<MixedInferredReturnType occurrences="1">
8-
<code>ReferenceConfigurator</code>
9-
</MixedInferredReturnType>
10-
<MixedReturnStatement occurrences="1">
11-
<code>($fn)($id)</code>
12-
</MixedReturnStatement>
137
</file>
148
<file src="src/Security/Authenticator/OAuth2Authenticator.php">
159
<PossiblyInvalidArgument occurrences="1">

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
"league/oauth2-server": "^8.0",
2323
"nyholm/psr7": "^1.4",
2424
"psr/http-factory": "^1.0",
25-
"symfony/framework-bundle": "^4.4|^5.0",
25+
"symfony/framework-bundle": "^5.1",
2626
"symfony/psr-http-message-bridge": "^2.0",
27-
"symfony/security-bundle": "^4.4|^5.0"
27+
"symfony/security-bundle": "^5.1.1"
2828
},
2929
"require-dev": {
3030
"ext-pdo": "*",
3131
"ext-pdo_sqlite": "*",
3232
"psalm/plugin-symfony": "^2.2",
33-
"symfony/browser-kit": "^4.4|^5.0",
33+
"symfony/browser-kit": "^5.1",
3434
"symfony/phpunit-bridge": "^5.2",
3535
"vimeo/psalm": "^4.6"
3636
},

src/DependencyInjection/Security/LegacyOAuth2Factory.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/LeagueOAuth2ServerBundle.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
88
use League\Bundle\OAuth2ServerBundle\DependencyInjection\LeagueOAuth2ServerExtension;
9-
use League\Bundle\OAuth2ServerBundle\DependencyInjection\Security\LegacyOAuth2Factory;
109
use League\Bundle\OAuth2ServerBundle\DependencyInjection\Security\OAuth2Factory;
11-
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AuthenticatorFactoryInterface;
1210
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
1311
use Symfony\Component\DependencyInjection\ContainerBuilder;
1412
use Symfony\Component\HttpKernel\Bundle\Bundle;
@@ -40,9 +38,7 @@ private function configureSecurityExtension(ContainerBuilder $container): void
4038
{
4139
/** @var SecurityExtension $extension */
4240
$extension = $container->getExtension('security');
43-
44-
// BC Layer for < 5.1 versions
45-
$extension->addSecurityListenerFactory(interface_exists(AuthenticatorFactoryInterface::class) ? new OAuth2Factory() : new LegacyOAuth2Factory());
41+
$extension->addSecurityListenerFactory(new OAuth2Factory());
4642
}
4743

4844
private function configureDoctrineExtension(ContainerBuilder $container): void

src/Resources/config/services.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
56
use function Symfony\Component\DependencyInjection\Loader\Configurator\tagged_iterator;
67
use League\Bundle\OAuth2ServerBundle\Command\ClearExpiredTokensCommand;
78
use League\Bundle\OAuth2ServerBundle\Command\CreateClientCommand;
@@ -54,25 +55,12 @@
5455
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
5556
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
5657
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
57-
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;
5858
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
5959
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
6060
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
6161
use Symfony\Component\Security\Core\Security;
6262
use Symfony\Component\Security\Core\User\UserProviderInterface;
6363

64-
// BC Layer for < 5.1 versions
65-
if (!function_exists('service')) {
66-
function service(string $id): ReferenceConfigurator
67-
{
68-
$fn = function_exists('Symfony\Component\DependencyInjection\Loader\Configurator\service')
69-
? 'Symfony\Component\DependencyInjection\Loader\Configurator\service'
70-
: 'Symfony\Component\DependencyInjection\Loader\Configurator\ref';
71-
72-
return ($fn)($id);
73-
}
74-
}
75-
7664
return static function (ContainerConfigurator $container): void {
7765
$container->services()
7866

0 commit comments

Comments
 (0)