Skip to content

Commit

Permalink
Added default names in the commands for lazy loading (#668)
Browse files Browse the repository at this point in the history
* added default names in the commands for lazy loading

* fixed codesniffer violation

* remove setName, because its done automatically by symfony
  • Loading branch information
22h authored Oct 22, 2020
1 parent 0a877e4 commit 1e6afb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Command/CleanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@

class CleanCommand extends Command
{
protected static $defaultName = 'fos:oauth-server:clean';

private $accessTokenManager;
private $refreshTokenManager;
private $authCodeManager;

public function __construct(
TokenManagerInterface $accessTokenManager,
TokenManagerInterface $refreshTokenManager,
AuthCodeManagerInterface $authCodeManager)
{
AuthCodeManagerInterface $authCodeManager
) {
parent::__construct();

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

$this
->setName('fos:oauth-server:clean')
->setDescription('Clean expired tokens')
->setHelp(<<<EOT
The <info>%command.name%</info> command will remove expired OAuth2 tokens.
Expand Down
3 changes: 2 additions & 1 deletion Command/CreateClientCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

class CreateClientCommand extends Command
{
protected static $defaultName = 'fos:oauth-server:create-client';

private $clientManager;

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

$this
->setName('fos:oauth-server:create-client')
->setDescription('Creates a new client')
->addOption(
'redirect-uri',
Expand Down

0 comments on commit 1e6afb6

Please sign in to comment.