Skip to content

Commit

Permalink
Support for --memory-limit CLI option in ClearResultCacheCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 22, 2022
1 parent 1aef99d commit 156700b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Command/ClearResultCacheCommand.php
Expand Up @@ -32,17 +32,20 @@ protected function configure(): void
->setDefinition([
new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'),
new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'),
new InputOption('memory-limit', null, InputOption::VALUE_REQUIRED, 'Memory limit for clearing result cache'),
]);
}

protected function execute(InputInterface $input, OutputInterface $output): int
{
$autoloadFile = $input->getOption('autoload-file');
$configuration = $input->getOption('configuration');
$memoryLimit = $input->getOption('memory-limit');

if (
(!is_string($autoloadFile) && $autoloadFile !== null)
|| (!is_string($configuration) && $configuration !== null)
|| (!is_string($memoryLimit) && $memoryLimit !== null)
) {
throw new ShouldNotHappenException();
}
Expand All @@ -52,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$input,
$output,
['.'],
null,
$memoryLimit,
$autoloadFile,
$this->composerAutoloaderProjectPaths,
$configuration,
Expand Down

0 comments on commit 156700b

Please sign in to comment.