Skip to content

Commit 1e6afb6

Browse files
authored
Added default names in the commands for lazy loading (#668)
* added default names in the commands for lazy loading * fixed codesniffer violation * remove setName, because its done automatically by symfony
1 parent 0a877e4 commit 1e6afb6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Command/CleanCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@
2121

2222
class CleanCommand extends Command
2323
{
24+
protected static $defaultName = 'fos:oauth-server:clean';
25+
2426
private $accessTokenManager;
2527
private $refreshTokenManager;
2628
private $authCodeManager;
2729

2830
public function __construct(
2931
TokenManagerInterface $accessTokenManager,
3032
TokenManagerInterface $refreshTokenManager,
31-
AuthCodeManagerInterface $authCodeManager)
32-
{
33+
AuthCodeManagerInterface $authCodeManager
34+
) {
3335
parent::__construct();
3436

3537
$this->accessTokenManager = $accessTokenManager;
@@ -45,7 +47,6 @@ protected function configure()
4547
parent::configure();
4648

4749
$this
48-
->setName('fos:oauth-server:clean')
4950
->setDescription('Clean expired tokens')
5051
->setHelp(<<<EOT
5152
The <info>%command.name%</info> command will remove expired OAuth2 tokens.

Command/CreateClientCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
class CreateClientCommand extends Command
2424
{
25+
protected static $defaultName = 'fos:oauth-server:create-client';
26+
2527
private $clientManager;
2628

2729
public function __construct(ClientManagerInterface $clientManager)
@@ -39,7 +41,6 @@ protected function configure()
3941
parent::configure();
4042

4143
$this
42-
->setName('fos:oauth-server:create-client')
4344
->setDescription('Creates a new client')
4445
->addOption(
4546
'redirect-uri',

0 commit comments

Comments
 (0)