Skip to content

Commit 308f234

Browse files
committed
Drop support for unmaintained Symfony versions
1 parent dd7948c commit 308f234

File tree

5 files changed

+12
-227
lines changed

5 files changed

+12
-227
lines changed

composer.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@
1414
],
1515
"require": {
1616
"php": ">=8.1",
17-
"symfony/framework-bundle": "^5.4|^6.0|^7.0",
18-
"symfony/dependency-injection": "^5.4|^6.0|^7.0",
19-
"symfony/routing": "^5.4|^6.0|^7.0",
20-
"symfony/http-foundation": "^5.4|^6.0|^7.0",
21-
"league/oauth2-client": "^2.0"
17+
"symfony/framework-bundle": "^6.4|^7.3",
18+
"symfony/dependency-injection": "^6.4|^7.3",
19+
"symfony/routing": "^6.4|^7.3",
20+
"symfony/http-foundation": "^6.4|^7.3",
21+
"league/oauth2-client": "^2.0",
22+
"symfony/security-core": "^6.4|^7.3",
23+
"symfony/security-http": "^6.4|^7.3"
2224
},
2325
"require-dev": {
2426
"league/oauth2-facebook": "^1.1|^2.0",
25-
"symfony/phpunit-bridge": "^5.4|^6.0|^7.0",
26-
"symfony/security-guard": "^5.4",
27-
"symfony/yaml": "^5.4|^6.0|^7.0"
27+
"symfony/phpunit-bridge": "^7.3",
28+
"symfony/yaml": "^6.4|^7.3"
2829
},
2930
"autoload": {
3031
"psr-4": { "KnpU\\OAuth2ClientBundle\\": "src/" }

src/Security/Authenticator/SocialAuthenticator.php

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

src/Security/Helper/SaveAuthFailureMessage.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Symfony\Component\HttpFoundation\Request;
1414
use Symfony\Component\HttpFoundation\Session\SessionInterface;
1515
use Symfony\Component\Security\Core\Exception\AuthenticationException;
16-
use Symfony\Component\Security\Core\Security;
1716
use Symfony\Component\Security\Http\SecurityRequestAttributes;
1817

1918
trait SaveAuthFailureMessage
@@ -24,10 +23,6 @@ protected function saveAuthenticationErrorToSession(Request $request, Authentica
2423
throw new \LogicException('In order to save an authentication error, you must have a session available.');
2524
}
2625

27-
$authenticationError = class_exists(Security::class)
28-
? Security::AUTHENTICATION_ERROR
29-
: SecurityRequestAttributes::AUTHENTICATION_ERROR;
30-
31-
$request->getSession()->set($authenticationError, $exception);
26+
$request->getSession()->set(SecurityRequestAttributes::AUTHENTICATION_ERROR, $exception);
3227
}
3328
}

tests/Security/Authenticator/SocialAuthenticatorTest.php

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

tests/Security/Helper/SaveAuthFailureMessageTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212

1313
use KnpU\OAuth2ClientBundle\Security\Helper\SaveAuthFailureMessage;
1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Component\HttpFoundation\Session\SessionInterface;
1615
use Symfony\Component\Security\Core\Exception\AuthenticationException;
17-
use Symfony\Component\Security\Core\Security;
16+
use Symfony\Component\Security\Http\SecurityRequestAttributes;
1817

1918
class SaveAuthFailureMessageTest extends TestCase
2019
{
@@ -41,7 +40,7 @@ public function testShouldUpdateSessionErrorIfSessionExists()
4140

4241
$testFailureMessage->callSaveAuthenticationErrorToSession($request, $mockAuthException);
4342
$session = $request->getSession();
44-
$this->assertInstanceOf(AuthenticationException::class, $session->get(Security::AUTHENTICATION_ERROR));
43+
$this->assertInstanceOf(AuthenticationException::class, $session->get(SecurityRequestAttributes::AUTHENTICATION_ERROR));
4544
}
4645
}
4746

0 commit comments

Comments
 (0)