File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616use FOS \OAuthServerBundle \Model \AuthCodeManagerInterface ;
1717use FOS \OAuthServerBundle \Model \TokenManagerInterface ;
18+ use Symfony \Component \Console \Attribute \AsCommand ;
1819use Symfony \Component \Console \Command \Command ;
1920use Symfony \Component \Console \Input \InputInterface ;
2021use 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 )]
2231class 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 */
Original file line number Diff line number Diff line change 1414namespace FOS \OAuthServerBundle \Command ;
1515
1616use FOS \OAuthServerBundle \Model \ClientManagerInterface ;
17+ use Symfony \Component \Console \Attribute \AsCommand ;
1718use Symfony \Component \Console \Command \Command ;
1819use Symfony \Component \Console \Input \InputInterface ;
1920use Symfony \Component \Console \Input \InputOption ;
2021use Symfony \Component \Console \Output \OutputInterface ;
2122use 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+ )]
2334class 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
You can’t perform that action at this time.
0 commit comments