From 156700b5152ada253edba34b39cda955729e97a8 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Sat, 22 Jan 2022 11:06:05 +0100 Subject: [PATCH] Support for --memory-limit CLI option in ClearResultCacheCommand --- src/Command/ClearResultCacheCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Command/ClearResultCacheCommand.php b/src/Command/ClearResultCacheCommand.php index 6b385e2819..b0478249ff 100644 --- a/src/Command/ClearResultCacheCommand.php +++ b/src/Command/ClearResultCacheCommand.php @@ -32,6 +32,7 @@ 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'), ]); } @@ -39,10 +40,12 @@ 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(); } @@ -52,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $input, $output, ['.'], - null, + $memoryLimit, $autoloadFile, $this->composerAutoloaderProjectPaths, $configuration,