Fix InstallActionHandler

This commit is contained in:
Clemente Raposo 2025-01-10 15:05:36 +00:00 committed by c.raposo
parent d2a0c04724
commit 759c4c0011

View file

@ -106,7 +106,13 @@ class InstallActionHandler implements ProcessHandlerInterface
if (empty($process->getOptions())) { if (empty($process->getOptions())) {
throw new InvalidArgumentException(self::MSG_OPTIONS_NOT_FOUND); throw new InvalidArgumentException(self::MSG_OPTIONS_NOT_FOUND);
} }
}
/**
* @inheritDoc
*/
public function run(Process $process)
{
$options = $process->getOptions(); $options = $process->getOptions();
$validOptions = [ $validOptions = [
@ -120,19 +126,19 @@ class InstallActionHandler implements ProcessHandlerInterface
'db_name' 'db_name'
]; ];
$missingOptions = [];
foreach ($validOptions as $validOption) { foreach ($validOptions as $validOption) {
if (empty($options['payload'][$validOption])) { if (empty($options['payload'][$validOption])) {
throw new InvalidArgumentException(self::MSG_OPTIONS_NOT_FOUND); $missingOptions[] = $validOption;
} }
} }
}
/** if(!empty($missingOptions)){
* @inheritDoc $process->setStatus('error');
*/ $process->setMessages(['Missing required options: ' . implode(', ', $missingOptions)]);
public function run(Process $process) $process->setData([]);
{ return;
$options = $process->getOptions(); }
global $installing; global $installing;
$installing = true; $installing = true;