| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Azine\JsCryptoStoreBundle\Command; |
||||
| 4 | |||||
| 5 | use Azine\JsCryptoStoreBundle\Entity\EncryptedFile; |
||||
| 6 | use Azine\JsCryptoStoreBundle\Entity\Repositories\EncryptedFileRepository; |
||||
| 7 | use Monolog\Logger; |
||||
| 8 | use Symfony\Bridge\Doctrine\ManagerRegistry; |
||||
|
0 ignored issues
–
show
|
|||||
| 9 | use Symfony\Component\Console\Command\Command; |
||||
| 10 | use Symfony\Component\Console\Input\InputInterface; |
||||
| 11 | use Symfony\Component\Console\Output\OutputInterface; |
||||
| 12 | |||||
| 13 | /** |
||||
| 14 | * Remove all encrypted file that are expired from the database. |
||||
| 15 | * |
||||
| 16 | * @author dominik |
||||
| 17 | */ |
||||
| 18 | class RemoveExpiredFilesCommand extends Command |
||||
| 19 | { |
||||
| 20 | /** |
||||
| 21 | * @var string|null The default command name |
||||
| 22 | */ |
||||
| 23 | protected static $defaultName = 'js-crypto-store:remove-expired'; |
||||
| 24 | |||||
| 25 | /** @var ManagerRegistry */ |
||||
| 26 | private $managerRegistry; |
||||
| 27 | |||||
| 28 | public function __construct(ManagerRegistry $managerRegistry, Logger $logger) |
||||
|
0 ignored issues
–
show
The parameter
$logger is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 29 | { |
||||
| 30 | parent::__construct(); |
||||
| 31 | $this->managerRegistry = $managerRegistry; |
||||
| 32 | } |
||||
| 33 | |||||
| 34 | protected function configure() |
||||
| 35 | { |
||||
| 36 | $this->setName(self::$defaultName) |
||||
| 37 | ->setDescription('Remove all encrypted file that are expired from the database') |
||||
| 38 | ->setHelp(<<<EOF |
||||
| 39 | The <info>js-crypto-store:remove-expired</info> command removes all expired files from the database. |
||||
| 40 | EOF |
||||
| 41 | ) |
||||
| 42 | ; |
||||
| 43 | } |
||||
| 44 | |||||
| 45 | protected function execute(InputInterface $input, OutputInterface $output) |
||||
| 46 | { |
||||
| 47 | /** @var EncryptedFileRepository $repository */ |
||||
| 48 | $repository = $this->managerRegistry->getRepository(EncryptedFile::class); |
||||
| 49 | $repository->removeExpiredFiles(); |
||||
| 50 | } |
||||
| 51 | } |
||||
| 52 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths