update patch 1
This commit is contained in:
+6
-5
@@ -42,7 +42,7 @@ class GenerateUuidCommand extends Command
|
||||
new InputOption('namespace', null, InputOption::VALUE_REQUIRED, 'The UUID to use at the namespace for named-based UUIDs, predefined namespaces keywords "dns", "url", "oid" and "x500" are accepted'),
|
||||
new InputOption('random-based', null, InputOption::VALUE_NONE, 'To generate a random-based UUID'),
|
||||
new InputOption('count', 'c', InputOption::VALUE_REQUIRED, 'The number of UUID to generate', 1),
|
||||
new InputOption('format', 'f', InputOption::VALUE_REQUIRED, sprintf('The UUID output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'rfc4122'),
|
||||
new InputOption('format', 'f', InputOption::VALUE_REQUIRED, \sprintf('The UUID output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'rfc4122'),
|
||||
])
|
||||
->setHelp(<<<'EOF'
|
||||
The <info>%command.name%</info> generates a UUID.
|
||||
@@ -115,7 +115,7 @@ EOF
|
||||
try {
|
||||
$node = Uuid::fromString($node);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$io->error(sprintf('Invalid node "%s": %s', $node, $e->getMessage()));
|
||||
$io->error(\sprintf('Invalid node "%s": %s', $node, $e->getMessage()));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ EOF
|
||||
try {
|
||||
new \DateTimeImmutable($time);
|
||||
} catch (\Exception $e) {
|
||||
$io->error(sprintf('Invalid timestamp "%s": %s', $time, str_replace('DateTimeImmutable::__construct(): ', '', $e->getMessage())));
|
||||
$io->error(\sprintf('Invalid timestamp "%s": %s', $time, str_replace('DateTimeImmutable::__construct(): ', '', $e->getMessage())));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ EOF
|
||||
try {
|
||||
$namespace = Uuid::fromString($namespace);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$io->error(sprintf('Invalid namespace "%s": %s', $namespace, $e->getMessage()));
|
||||
$io->error(\sprintf('Invalid namespace "%s": %s', $namespace, $e->getMessage()));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ EOF
|
||||
if (\in_array($formatOption, $this->getAvailableFormatOptions(), true)) {
|
||||
$format = 'to'.ucfirst($formatOption);
|
||||
} else {
|
||||
$io->error(sprintf('Invalid format "%s", supported formats are "%s".', $formatOption, implode('", "', $this->getAvailableFormatOptions())));
|
||||
$io->error(\sprintf('Invalid format "%s", supported formats are "%s".', $formatOption, implode('", "', $this->getAvailableFormatOptions())));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -194,6 +194,7 @@ EOF
|
||||
}
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
private function getAvailableFormatOptions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user