Skip to content

Commit

Permalink
Merge pull request #3047 from stof/symfony_6
Browse files Browse the repository at this point in the history
Add support for Symfony 6
  • Loading branch information
stof committed Oct 26, 2022
2 parents 1cbe2a0 + 4bcde71 commit cba15a7
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- description: 'Symfony 4.*'
php: '7.4'
symfony-versions: '^4.4'
- description: 'Symfony 5.*'
php: '8.1'
symfony-versions: '^5.4'
name: PHP ${{ matrix.php }} ${{ matrix.description }}
steps:
- name: Checkout
Expand Down
4 changes: 4 additions & 0 deletions Command/ActivateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace FOS\UserBundle\Command;

use FOS\UserBundle\Util\UserManipulator;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -25,8 +26,10 @@
*
* @final
*/
#[AsCommand(name: 'fos:user:activate', description: 'Activate a user')]
class ActivateUserCommand extends Command
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:activate';

private $userManipulator;
Expand All @@ -44,6 +47,7 @@ public function __construct(UserManipulator $userManipulator)
protected function configure()
{
$this
// BC with Symfony <5.3
->setName('fos:user:activate')
->setDescription('Activate a user')
->setDefinition([
Expand Down
4 changes: 4 additions & 0 deletions Command/ChangePasswordCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace FOS\UserBundle\Command;

use FOS\UserBundle\Util\UserManipulator;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -23,8 +24,10 @@
*
* @final
*/
#[AsCommand(name: 'fos:user:change-password', description: 'Change the password of a user.')]
class ChangePasswordCommand extends Command
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:change-password';

private $userManipulator;
Expand All @@ -42,6 +45,7 @@ public function __construct(UserManipulator $userManipulator)
protected function configure()
{
$this
// BC with Symfony <5.3
->setName('fos:user:change-password')
->setDescription('Change the password of a user.')
->setDefinition([
Expand Down
4 changes: 4 additions & 0 deletions Command/CreateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace FOS\UserBundle\Command;

use FOS\UserBundle\Util\UserManipulator;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -28,8 +29,10 @@
*
* @final
*/
#[AsCommand(name: 'fos:user:create', description: 'Create a user.')]
class CreateUserCommand extends Command
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:create';

private $userManipulator;
Expand All @@ -47,6 +50,7 @@ public function __construct(UserManipulator $userManipulator)
protected function configure()
{
$this
// BC with Symfony <5.3
->setName('fos:user:create')
->setDescription('Create a user.')
->setDefinition([
Expand Down
4 changes: 4 additions & 0 deletions Command/DeactivateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace FOS\UserBundle\Command;

use FOS\UserBundle\Util\UserManipulator;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -25,8 +26,10 @@
*
* @final
*/
#[AsCommand(name: 'fos:user:deactivate', description: 'Deactivate a user')]
class DeactivateUserCommand extends Command
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:deactivate';

private $userManipulator;
Expand All @@ -44,6 +47,7 @@ public function __construct(UserManipulator $userManipulator)
protected function configure()
{
$this
// BC with Symfony <5.3
->setName('fos:user:deactivate')
->setDescription('Deactivate a user')
->setDefinition([
Expand Down
4 changes: 4 additions & 0 deletions Command/DemoteUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace FOS\UserBundle\Command;

use FOS\UserBundle\Util\UserManipulator;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Output\OutputInterface;

/**
Expand All @@ -22,8 +23,10 @@
*
* @final
*/
#[AsCommand(name: 'fos:user:demote', description: 'Demote a user by removing a role')]
class DemoteUserCommand extends RoleCommand
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:demote';

/**
Expand All @@ -34,6 +37,7 @@ protected function configure()
parent::configure();

$this
// BC with Symfony <5.3
->setName('fos:user:demote')
->setDescription('Demote a user by removing a role')
->setHelp(<<<'EOT'
Expand Down
4 changes: 4 additions & 0 deletions Command/PromoteUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace FOS\UserBundle\Command;

use FOS\UserBundle\Util\UserManipulator;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Output\OutputInterface;

/**
Expand All @@ -24,8 +25,10 @@
*
* @final
*/
#[AsCommand(name: 'fos:user:promote', description: 'Promotes a user by adding a role')]
class PromoteUserCommand extends RoleCommand
{
// BC with Symfony <5.3
protected static $defaultName = 'fos:user:promote';

/**
Expand All @@ -36,6 +39,7 @@ protected function configure()
parent::configure();

$this
// BC with Symfony <5.3
->setName('fos:user:promote')
->setDescription('Promotes a user by adding a role')
->setHelp(<<<'EOT'
Expand Down
34 changes: 17 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
"php": "^7.4 || ^8.0",
"ext-dom": "*",
"ext-json": "*",
"symfony/config": "^4.4 || ^5.0",
"symfony/dependency-injection": "^4.4 || ^5.0",
"symfony/event-dispatcher": "^4.4 || ^5.0",
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0",
"symfony/form": "^4.4 || ^5.0",
"symfony/framework-bundle": "^4.4 || ^5.0",
"symfony/http-foundation": "^4.4 || ^5.0",
"symfony/http-kernel": "^4.4 || ^5.0",
"symfony/options-resolver": "^4.4 || ^5.0",
"symfony/routing": "^4.4 || ^5.0",
"symfony/security-bundle": "^4.4 || ^5.0",
"symfony/security-core": "^4.4 || ^5.0",
"symfony/translation": "^4.4 || ^5.0",
"symfony/twig-bundle": "^4.4 || ^5.0",
"symfony/validator": "^4.4 || ^5.0",
"symfony/config": "^4.4 || ^5.0 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
"symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0",
"symfony/event-dispatcher-contracts": "^1.1 || ^2.0 || ^3.0",
"symfony/form": "^4.4 || ^5.0 || ^6.0",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0",
"symfony/http-foundation": "^4.4 || ^5.0 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0",
"symfony/options-resolver": "^4.4 || ^5.0 || ^6.0",
"symfony/routing": "^4.4 || ^5.0 || ^6.0",
"symfony/security-bundle": "^4.4 || ^5.0 || ^6.0",
"symfony/security-core": "^4.4 || ^5.0 || ^6.0",
"symfony/translation": "^4.4 || ^5.0 || ^6.0",
"symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0",
"symfony/validator": "^4.4 || ^5.0 || ^6.0",
"twig/twig": "^1.34 || ^2.4 || ^3.0"
},
"conflict": {
Expand All @@ -50,9 +50,9 @@
"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",
"symfony/console": "^4.4 || ^5.0 || ^6.0",
"symfony/phpunit-bridge": "^6.1",
"symfony/yaml": "^4.4 || ^5.0"
"symfony/yaml": "^4.4 || ^5.0 || ^6.0"
},
"config": {
"sort-packages": true
Expand Down

0 comments on commit cba15a7

Please sign in to comment.