Skip to content

Commit

Permalink
Stricter validation
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins committed Nov 30, 2023
1 parent ecd7fca commit b7e5a03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Command/Environment/EnvironmentPushCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ protected function execute(InputInterface $input, OutputInterface $output)

// Validate the --resources-init option.
$resourcesInit = $input->getOption('resources-init');
if ($resourcesInit !== null && !preg_match('/^[a-z0-9-]+$/', $resourcesInit)) {
$this->stdErr->writeln('The value for <error>--resources-init</error> is not valid.');
$this->stdErr->writeln('It can be one of: default, parent, minimum, or manual.');
$resourcesInitOptions = ['default', 'parent', 'minimum', 'manual'];
if ($resourcesInit !== null && !\in_array($resourcesInit, $resourcesInitOptions, true)) {
$this->stdErr->writeln('The value for <error>--resources-init</error> must be one of: ' . \implode(', ', $resourcesInitOptions));
return 1;
}

Expand Down

0 comments on commit b7e5a03

Please sign in to comment.