Skip to content

Commit cba15a7

Browse files
authored
Merge pull request #3047 from stof/symfony_6
Add support for Symfony 6
2 parents 1cbe2a0 + 4bcde71 commit cba15a7

8 files changed

+44
-17
lines changed

.github/workflows/ci.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- description: 'Symfony 4.*'
2323
php: '7.4'
2424
symfony-versions: '^4.4'
25+
- description: 'Symfony 5.*'
26+
php: '8.1'
27+
symfony-versions: '^5.4'
2528
name: PHP ${{ matrix.php }} ${{ matrix.description }}
2629
steps:
2730
- name: Checkout

Command/ActivateUserCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace FOS\UserBundle\Command;
1313

1414
use FOS\UserBundle\Util\UserManipulator;
15+
use Symfony\Component\Console\Attribute\AsCommand;
1516
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
@@ -25,8 +26,10 @@
2526
*
2627
* @final
2728
*/
29+
#[AsCommand(name: 'fos:user:activate', description: 'Activate a user')]
2830
class ActivateUserCommand extends Command
2931
{
32+
// BC with Symfony <5.3
3033
protected static $defaultName = 'fos:user:activate';
3134

3235
private $userManipulator;
@@ -44,6 +47,7 @@ public function __construct(UserManipulator $userManipulator)
4447
protected function configure()
4548
{
4649
$this
50+
// BC with Symfony <5.3
4751
->setName('fos:user:activate')
4852
->setDescription('Activate a user')
4953
->setDefinition([

Command/ChangePasswordCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace FOS\UserBundle\Command;
1313

1414
use FOS\UserBundle\Util\UserManipulator;
15+
use Symfony\Component\Console\Attribute\AsCommand;
1516
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
@@ -23,8 +24,10 @@
2324
*
2425
* @final
2526
*/
27+
#[AsCommand(name: 'fos:user:change-password', description: 'Change the password of a user.')]
2628
class ChangePasswordCommand extends Command
2729
{
30+
// BC with Symfony <5.3
2831
protected static $defaultName = 'fos:user:change-password';
2932

3033
private $userManipulator;
@@ -42,6 +45,7 @@ public function __construct(UserManipulator $userManipulator)
4245
protected function configure()
4346
{
4447
$this
48+
// BC with Symfony <5.3
4549
->setName('fos:user:change-password')
4650
->setDescription('Change the password of a user.')
4751
->setDefinition([

Command/CreateUserCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace FOS\UserBundle\Command;
1313

1414
use FOS\UserBundle\Util\UserManipulator;
15+
use Symfony\Component\Console\Attribute\AsCommand;
1516
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
@@ -28,8 +29,10 @@
2829
*
2930
* @final
3031
*/
32+
#[AsCommand(name: 'fos:user:create', description: 'Create a user.')]
3133
class CreateUserCommand extends Command
3234
{
35+
// BC with Symfony <5.3
3336
protected static $defaultName = 'fos:user:create';
3437

3538
private $userManipulator;
@@ -47,6 +50,7 @@ public function __construct(UserManipulator $userManipulator)
4750
protected function configure()
4851
{
4952
$this
53+
// BC with Symfony <5.3
5054
->setName('fos:user:create')
5155
->setDescription('Create a user.')
5256
->setDefinition([

Command/DeactivateUserCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace FOS\UserBundle\Command;
1313

1414
use FOS\UserBundle\Util\UserManipulator;
15+
use Symfony\Component\Console\Attribute\AsCommand;
1516
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
@@ -25,8 +26,10 @@
2526
*
2627
* @final
2728
*/
29+
#[AsCommand(name: 'fos:user:deactivate', description: 'Deactivate a user')]
2830
class DeactivateUserCommand extends Command
2931
{
32+
// BC with Symfony <5.3
3033
protected static $defaultName = 'fos:user:deactivate';
3134

3235
private $userManipulator;
@@ -44,6 +47,7 @@ public function __construct(UserManipulator $userManipulator)
4447
protected function configure()
4548
{
4649
$this
50+
// BC with Symfony <5.3
4751
->setName('fos:user:deactivate')
4852
->setDescription('Deactivate a user')
4953
->setDefinition([

Command/DemoteUserCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace FOS\UserBundle\Command;
1313

1414
use FOS\UserBundle\Util\UserManipulator;
15+
use Symfony\Component\Console\Attribute\AsCommand;
1516
use Symfony\Component\Console\Output\OutputInterface;
1617

1718
/**
@@ -22,8 +23,10 @@
2223
*
2324
* @final
2425
*/
26+
#[AsCommand(name: 'fos:user:demote', description: 'Demote a user by removing a role')]
2527
class DemoteUserCommand extends RoleCommand
2628
{
29+
// BC with Symfony <5.3
2730
protected static $defaultName = 'fos:user:demote';
2831

2932
/**
@@ -34,6 +37,7 @@ protected function configure()
3437
parent::configure();
3538

3639
$this
40+
// BC with Symfony <5.3
3741
->setName('fos:user:demote')
3842
->setDescription('Demote a user by removing a role')
3943
->setHelp(<<<'EOT'

Command/PromoteUserCommand.php

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace FOS\UserBundle\Command;
1313

1414
use FOS\UserBundle\Util\UserManipulator;
15+
use Symfony\Component\Console\Attribute\AsCommand;
1516
use Symfony\Component\Console\Output\OutputInterface;
1617

1718
/**
@@ -24,8 +25,10 @@
2425
*
2526
* @final
2627
*/
28+
#[AsCommand(name: 'fos:user:promote', description: 'Promotes a user by adding a role')]
2729
class PromoteUserCommand extends RoleCommand
2830
{
31+
// BC with Symfony <5.3
2932
protected static $defaultName = 'fos:user:promote';
3033

3134
/**
@@ -36,6 +39,7 @@ protected function configure()
3639
parent::configure();
3740

3841
$this
42+
// BC with Symfony <5.3
3943
->setName('fos:user:promote')
4044
->setDescription('Promotes a user by adding a role')
4145
->setHelp(<<<'EOT'

composer.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424
"php": "^7.4 || ^8.0",
2525
"ext-dom": "*",
2626
"ext-json": "*",
27-
"symfony/config": "^4.4 || ^5.0",
28-
"symfony/dependency-injection": "^4.4 || ^5.0",
29-
"symfony/event-dispatcher": "^4.4 || ^5.0",
30-
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0",
31-
"symfony/form": "^4.4 || ^5.0",
32-
"symfony/framework-bundle": "^4.4 || ^5.0",
33-
"symfony/http-foundation": "^4.4 || ^5.0",
34-
"symfony/http-kernel": "^4.4 || ^5.0",
35-
"symfony/options-resolver": "^4.4 || ^5.0",
36-
"symfony/routing": "^4.4 || ^5.0",
37-
"symfony/security-bundle": "^4.4 || ^5.0",
38-
"symfony/security-core": "^4.4 || ^5.0",
39-
"symfony/translation": "^4.4 || ^5.0",
40-
"symfony/twig-bundle": "^4.4 || ^5.0",
41-
"symfony/validator": "^4.4 || ^5.0",
27+
"symfony/config": "^4.4 || ^5.0 || ^6.0",
28+
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
29+
"symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0",
30+
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0 || ^3.0",
31+
"symfony/form": "^4.4 || ^5.0 || ^6.0",
32+
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0",
33+
"symfony/http-foundation": "^4.4 || ^5.0 || ^6.0",
34+
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0",
35+
"symfony/options-resolver": "^4.4 || ^5.0 || ^6.0",
36+
"symfony/routing": "^4.4 || ^5.0 || ^6.0",
37+
"symfony/security-bundle": "^4.4 || ^5.0 || ^6.0",
38+
"symfony/security-core": "^4.4 || ^5.0 || ^6.0",
39+
"symfony/translation": "^4.4 || ^5.0 || ^6.0",
40+
"symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0",
41+
"symfony/validator": "^4.4 || ^5.0 || ^6.0",
4242
"twig/twig": "^1.34 || ^2.4 || ^3.0"
4343
},
4444
"conflict": {
@@ -50,9 +50,9 @@
5050
"doctrine/doctrine-bundle": "^1.3 || ^2",
5151
"friendsofphp/php-cs-fixer": "^3.0.2, !=3.5.0",
5252
"swiftmailer/swiftmailer": "^4.3 || ^5.0 || ^6.0",
53-
"symfony/console": "^4.4 || ^5.0",
53+
"symfony/console": "^4.4 || ^5.0 || ^6.0",
5454
"symfony/phpunit-bridge": "^6.1",
55-
"symfony/yaml": "^4.4 || ^5.0"
55+
"symfony/yaml": "^4.4 || ^5.0 || ^6.0"
5656
},
5757
"config": {
5858
"sort-packages": true

0 commit comments

Comments
 (0)