Skip to content

Commit ede250e

Browse files
author
klapaudius
committed
Incompatibility with upgrade to Symfony 8.1
#56
1 parent 4f1b040 commit ede250e

2 files changed

Lines changed: 20 additions & 30 deletions

File tree

Command/CleanCommand.php

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@
1515

1616
use FOS\OAuthServerBundle\Model\AuthCodeManagerInterface;
1717
use FOS\OAuthServerBundle\Model\TokenManagerInterface;
18+
use Symfony\Component\Console\Attribute\AsCommand;
1819
use Symfony\Component\Console\Command\Command;
1920
use Symfony\Component\Console\Input\InputInterface;
2021
use Symfony\Component\Console\Output\OutputInterface;
2122

23+
#[AsCommand(
24+
name: 'fos:oauth-server:clean',
25+
description: 'Clean expired tokens',
26+
help: <<<EOT
27+
The <info>%command.name%</info> command will remove expired OAuth2 tokens.
28+
29+
<info>php %command.full_name%</info>
30+
EOT )]
2231
class CleanCommand extends Command
2332
{
2433
private TokenManagerInterface $accessTokenManager;
@@ -37,26 +46,6 @@ public function __construct(
3746
$this->authCodeManager = $authCodeManager;
3847
}
3948

40-
/**
41-
* {@inheritdoc}
42-
*/
43-
protected function configure(): void
44-
{
45-
parent::configure();
46-
47-
$this
48-
->setName('fos:oauth-server:clean')
49-
->setDescription('Clean expired tokens')
50-
->setHelp(
51-
<<<EOT
52-
The <info>%command.name%</info> command will remove expired OAuth2 tokens.
53-
54-
<info>php %command.full_name%</info>
55-
EOT
56-
)
57-
;
58-
}
59-
6049
/**
6150
* {@inheritdoc}
6251
*/

Command/CreateClientCommand.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,23 @@
1414
namespace FOS\OAuthServerBundle\Command;
1515

1616
use FOS\OAuthServerBundle\Model\ClientManagerInterface;
17+
use Symfony\Component\Console\Attribute\AsCommand;
1718
use Symfony\Component\Console\Command\Command;
1819
use Symfony\Component\Console\Input\InputInterface;
1920
use Symfony\Component\Console\Input\InputOption;
2021
use Symfony\Component\Console\Output\OutputInterface;
2122
use Symfony\Component\Console\Style\SymfonyStyle;
2223

24+
#[AsCommand(
25+
name: 'fos:oauth-server:create-client',
26+
description: 'Creates a new client',
27+
help: <<<EOT
28+
The <info>%command.name%</info> command creates a new client.
29+
30+
<info>php %command.full_name% [--redirect-uri=...] [--grant-type=...]</info>
31+
32+
EOT,
33+
)]
2334
class CreateClientCommand extends Command
2435
{
2536
/**
@@ -42,8 +53,6 @@ protected function configure(): void
4253
parent::configure();
4354

4455
$this
45-
->setName('fos:oauth-server:create-client')
46-
->setDescription('Creates a new client')
4756
->addOption(
4857
'redirect-uri',
4958
null,
@@ -58,14 +67,6 @@ protected function configure(): void
5867
'Sets allowed grant type for client. Use this option multiple times to set multiple grant types..',
5968
null
6069
)
61-
->setHelp(
62-
<<<EOT
63-
The <info>%command.name%</info> command creates a new client.
64-
65-
<info>php %command.full_name% [--redirect-uri=...] [--grant-type=...]</info>
66-
67-
EOT
68-
)
6970
;
7071
}
7172

0 commit comments

Comments
 (0)