Skip to content

Commit 156700b

Browse files
committed
Support for --memory-limit CLI option in ClearResultCacheCommand
1 parent 1aef99d commit 156700b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Command/ClearResultCacheCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,20 @@ protected function configure(): void
3232
->setDefinition([
3333
new InputOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Path to project configuration file'),
3434
new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'),
35+
new InputOption('memory-limit', null, InputOption::VALUE_REQUIRED, 'Memory limit for clearing result cache'),
3536
]);
3637
}
3738

3839
protected function execute(InputInterface $input, OutputInterface $output): int
3940
{
4041
$autoloadFile = $input->getOption('autoload-file');
4142
$configuration = $input->getOption('configuration');
43+
$memoryLimit = $input->getOption('memory-limit');
4244

4345
if (
4446
(!is_string($autoloadFile) && $autoloadFile !== null)
4547
|| (!is_string($configuration) && $configuration !== null)
48+
|| (!is_string($memoryLimit) && $memoryLimit !== null)
4649
) {
4750
throw new ShouldNotHappenException();
4851
}
@@ -52,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5255
$input,
5356
$output,
5457
['.'],
55-
null,
58+
$memoryLimit,
5659
$autoloadFile,
5760
$this->composerAutoloaderProjectPaths,
5861
$configuration,

0 commit comments

Comments
 (0)