Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump min versions to Symfony 6.4 and PHP 8.1 #3077

Merged
merged 2 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,11 @@ jobs:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
symfony-versions: [false]
include:
- description: 'Symfony 4.*'
php: '7.4'
symfony-versions: '^4.4'
- description: 'Symfony 5.*'
php: '8.1'
symfony-versions: '^5.4'
- description: 'Symfony 6.*'
php: '8.2'
symfony-versions: '^6.4'
Expand Down
45 changes: 23 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,42 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.1",
"ext-dom": "*",
"ext-json": "*",
"symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/deprecation-contracts": "^2.5 || ^3.5",
"symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/event-dispatcher": "^6.4 || ^7.0",
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0 || ^3.0",
"symfony/form": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/http-foundation": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/options-resolver": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/routing": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/security-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/security-core": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/translation": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/validator": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"twig/twig": "^1.34 || ^2.4 || ^3.0"
"symfony/form": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/http-foundation": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/options-resolver": "^6.4 || ^7.0",
"symfony/password-hasher": "^6.4 || ^7.0",
"symfony/routing": "^6.4 || ^7.0",
"symfony/security-bundle": "^6.4 || ^7.0",
"symfony/security-core": "^6.4 || ^7.0",
"symfony/translation": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony/validator": "^6.4 || ^7.0",
"twig/twig": "^2.13 || ^3.0"
},
"conflict": {
"doctrine/doctrine-bundle": "<1.3",
"doctrine/persistence": "<1.3",
"symfony/doctrine-bridge": "<4.4"
"symfony/doctrine-bridge": "<6.4"
},
"require-dev": {
"doctrine/doctrine-bundle": "^1.3 || ^2",
"friendsofphp/php-cs-fixer": "^3.0.2, !=3.5.0",
"swiftmailer/swiftmailer": "^4.3 || ^5.0 || ^6.0",
"symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/mailer": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/mime": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^6.1",
"symfony/yaml": "^4.4 || ^5.0 || ^6.0 || ^7.0"
"symfony/console": "^6.4 || ^7.0",
"symfony/mailer": "^6.4 || ^7.0",
"symfony/mime": "^6.4 || ^7.0",
"symfony/phpunit-bridge": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0"
},
"config": {
"sort-packages": true
Expand Down
6 changes: 0 additions & 6 deletions src/Command/ActivateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
#[AsCommand(name: 'fos:user:activate', description: 'Activate a user')]
final class ActivateUserCommand extends Command
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:activate';

private $userManipulator;

public function __construct(UserManipulator $userManipulator)
Expand All @@ -43,9 +40,6 @@ public function __construct(UserManipulator $userManipulator)
protected function configure(): void
{
$this
// BC with Symfony <5.3
->setName('fos:user:activate')
->setDescription('Activate a user')
->setDefinition([
new InputArgument('username', InputArgument::REQUIRED, 'The username'),
])
Expand Down
6 changes: 0 additions & 6 deletions src/Command/ChangePasswordCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#[AsCommand(name: 'fos:user:change-password', description: 'Change the password of a user.')]
final class ChangePasswordCommand extends Command
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:change-password';

private $userManipulator;

public function __construct(UserManipulator $userManipulator)
Expand All @@ -41,9 +38,6 @@ public function __construct(UserManipulator $userManipulator)
protected function configure(): void
{
$this
// BC with Symfony <5.3
->setName('fos:user:change-password')
->setDescription('Change the password of a user.')
->setDefinition([
new InputArgument('username', InputArgument::REQUIRED, 'The username'),
new InputArgument('password', InputArgument::REQUIRED, 'The password'),
Expand Down
6 changes: 0 additions & 6 deletions src/Command/CreateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
#[AsCommand(name: 'fos:user:create', description: 'Create a user.')]
final class CreateUserCommand extends Command
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:create';

private $userManipulator;

public function __construct(UserManipulator $userManipulator)
Expand All @@ -46,9 +43,6 @@ public function __construct(UserManipulator $userManipulator)
protected function configure(): void
{
$this
// BC with Symfony <5.3
->setName('fos:user:create')
->setDescription('Create a user.')
->setDefinition([
new InputArgument('username', InputArgument::REQUIRED, 'The username'),
new InputArgument('email', InputArgument::REQUIRED, 'The email'),
Expand Down
6 changes: 0 additions & 6 deletions src/Command/DeactivateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
#[AsCommand(name: 'fos:user:deactivate', description: 'Deactivate a user')]
final class DeactivateUserCommand extends Command
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:deactivate';

private $userManipulator;

public function __construct(UserManipulator $userManipulator)
Expand All @@ -43,9 +40,6 @@ public function __construct(UserManipulator $userManipulator)
protected function configure(): void
{
$this
// BC with Symfony <5.3
->setName('fos:user:deactivate')
->setDescription('Deactivate a user')
->setDefinition([
new InputArgument('username', InputArgument::REQUIRED, 'The username'),
])
Expand Down
6 changes: 0 additions & 6 deletions src/Command/DemoteUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,11 @@
#[AsCommand(name: 'fos:user:demote', description: 'Demote a user by removing a role')]
final class DemoteUserCommand extends RoleCommand
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:demote';

protected function configure(): void
{
parent::configure();

$this
// BC with Symfony <5.3
->setName('fos:user:demote')
->setDescription('Demote a user by removing a role')
->setHelp(<<<'EOT'
The <info>fos:user:demote</info> command demotes a user by removing a role

Expand Down
6 changes: 0 additions & 6 deletions src/Command/PromoteUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,11 @@
#[AsCommand(name: 'fos:user:promote', description: 'Promotes a user by adding a role')]
final class PromoteUserCommand extends RoleCommand
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:promote';

protected function configure(): void
{
parent::configure();

$this
// BC with Symfony <5.3
->setName('fos:user:promote')
->setDescription('Promotes a user by adding a role')
->setHelp(<<<'EOT'
The <info>fos:user:promote</info> command promotes a user by adding a role

Expand Down
35 changes: 0 additions & 35 deletions src/CompatibilityUtil.php

This file was deleted.

3 changes: 1 addition & 2 deletions src/Controller/ChangePasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace FOS\UserBundle\Controller;

use FOS\UserBundle\CompatibilityUtil;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\GetResponseUserEvent;
Expand Down Expand Up @@ -40,7 +39,7 @@ final class ChangePasswordController extends AbstractController

public function __construct(EventDispatcherInterface $eventDispatcher, FactoryInterface $formFactory, UserManagerInterface $userManager)
{
$this->eventDispatcher = CompatibilityUtil::upgradeEventDispatcher($eventDispatcher);
$this->eventDispatcher = $eventDispatcher;
$this->formFactory = $formFactory;
$this->userManager = $userManager;
}
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace FOS\UserBundle\Controller;

use FOS\UserBundle\CompatibilityUtil;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\GetResponseUserEvent;
Expand Down Expand Up @@ -39,7 +38,7 @@ final class ProfileController extends AbstractController

public function __construct(EventDispatcherInterface $eventDispatcher, FactoryInterface $formFactory, UserManagerInterface $userManager)
{
$this->eventDispatcher = CompatibilityUtil::upgradeEventDispatcher($eventDispatcher);
$this->eventDispatcher = $eventDispatcher;
$this->formFactory = $formFactory;
$this->userManager = $userManager;
}
Expand Down
6 changes: 1 addition & 5 deletions src/Controller/RegistrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace FOS\UserBundle\Controller;

use FOS\UserBundle\CompatibilityUtil;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\GetResponseUserEvent;
Expand Down Expand Up @@ -43,7 +42,7 @@ final class RegistrationController extends AbstractController

public function __construct(EventDispatcherInterface $eventDispatcher, FactoryInterface $formFactory, UserManagerInterface $userManager, TokenStorageInterface $tokenStorage)
{
$this->eventDispatcher = CompatibilityUtil::upgradeEventDispatcher($eventDispatcher);
$this->eventDispatcher = $eventDispatcher;
$this->formFactory = $formFactory;
$this->userManager = $userManager;
$this->tokenStorage = $tokenStorage;
Expand Down Expand Up @@ -178,9 +177,6 @@ private function getTargetUrlFromSession(SessionInterface $session): ?string

if (method_exists($token, 'getFirewallName')) {
$firewallName = $token->getFirewallName();
} elseif (method_exists($token, 'getProviderKey')) {
// BC with Symfony 5.x
$firewallName = $token->getProviderKey();
} else {
return null;
}
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/ResettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace FOS\UserBundle\Controller;

use FOS\UserBundle\CompatibilityUtil;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\GetResponseNullableUserEvent;
Expand Down Expand Up @@ -51,7 +50,7 @@ final class ResettingController extends AbstractController
*/
public function __construct(EventDispatcherInterface $eventDispatcher, FactoryInterface $formFactory, UserManagerInterface $userManager, TokenGeneratorInterface $tokenGenerator, MailerInterface $mailer, $retryTtl)
{
$this->eventDispatcher = CompatibilityUtil::upgradeEventDispatcher($eventDispatcher);
$this->eventDispatcher = $eventDispatcher;
$this->formFactory = $formFactory;
$this->userManager = $userManager;
$this->tokenGenerator = $tokenGenerator;
Expand Down
36 changes: 0 additions & 36 deletions src/DependencyInjection/Compiler/ConfigurePasswordHasherPass.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ public function process(ContainerBuilder $container): void

if ($container->has('security.authenticator.remember_me_handler.'.$firewallName)) {
$loginManager->replaceArgument(4, new Reference('security.authenticator.remember_me_handler.'.$firewallName));
} elseif ($container->hasDefinition('security.authentication.rememberme.services.persistent.'.$firewallName)) {
$loginManager->replaceArgument(4, new Reference('security.authentication.rememberme.services.persistent.'.$firewallName));
} elseif ($container->hasDefinition('security.authentication.rememberme.services.simplehash.'.$firewallName)) {
$loginManager->replaceArgument(4, new Reference('security.authentication.rememberme.services.simplehash.'.$firewallName));
}
}
}
2 changes: 0 additions & 2 deletions src/EventListener/AuthenticationListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace FOS\UserBundle\EventListener;

use FOS\UserBundle\CompatibilityUtil;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\UserEvent;
use FOS\UserBundle\FOSUserEvents;
Expand Down Expand Up @@ -62,7 +61,6 @@ public static function getSubscribedEvents(): array
*/
public function authenticate(FilterUserResponseEvent $event, $eventName, EventDispatcherInterface $eventDispatcher)
{
$eventDispatcher = CompatibilityUtil::upgradeEventDispatcher($eventDispatcher);
try {
$this->loginManager->logInUser($this->firewallName, $event->getUser(), $event->getResponse());

Expand Down
2 changes: 0 additions & 2 deletions src/FOSUserBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass;
use FOS\UserBundle\DependencyInjection\Compiler\CheckForSessionPass;
use FOS\UserBundle\DependencyInjection\Compiler\CheckForSwiftMailerPass;
use FOS\UserBundle\DependencyInjection\Compiler\ConfigurePasswordHasherPass;
use FOS\UserBundle\DependencyInjection\Compiler\InjectRememberMeServicesPass;
use FOS\UserBundle\DependencyInjection\Compiler\InjectUserCheckerPass;
use FOS\UserBundle\DependencyInjection\Compiler\ValidationPass;
Expand All @@ -31,7 +30,6 @@ final class FOSUserBundle extends Bundle
public function build(ContainerBuilder $container): void
{
parent::build($container);
$container->addCompilerPass(new ConfigurePasswordHasherPass());
$container->addCompilerPass(new ValidationPass());
$container->addCompilerPass(new InjectUserCheckerPass());
$container->addCompilerPass(new InjectRememberMeServicesPass());
Expand Down
Loading
Loading