-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix archivist command service injection (#35)
* Fix typo * Change ArchiveTokenCommand service injection
- Loading branch information
1 parent
cc31573
commit d2e32f2
Showing
3 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
namespace Yokai\SecurityTokenBundle\Command; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
@@ -11,8 +11,20 @@ | |
/** | ||
* @author Yann Eugoné <[email protected]> | ||
*/ | ||
class ArchiveTokenCommand extends ContainerAwareCommand | ||
class ArchiveTokenCommand extends Command | ||
{ | ||
/** | ||
* @var ArchivistInterface | ||
*/ | ||
private $archivist; | ||
|
||
public function __construct(ArchivistInterface $archivist) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->archivist = $archivist; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
|
@@ -39,10 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output) | |
); | ||
} | ||
|
||
/** @var $archivist ArchivistInterface */ | ||
$archivist = $this->getContainer()->get('yokai_security_token.archivist'); | ||
|
||
$count = $archivist->archive($purpose); | ||
$count = $this->archivist->archive($purpose); | ||
|
||
$output->writeln( | ||
sprintf('<info>Successfully archived <comment>%d</comment> security token(s).</info>', $count) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters