diff --git a/src/Console/Command/TaskCommand.php b/src/Console/Command/TaskCommand.php index cdc2077c..54d415a6 100644 --- a/src/Console/Command/TaskCommand.php +++ b/src/Console/Command/TaskCommand.php @@ -108,6 +108,10 @@ protected function configure(): void $taskArgumentAttribute->suggestedValues, ); } elseif ($taskArgumentAttribute instanceof AsOption) { + if ('verbose' === $name) { + throw new FunctionConfigurationException('You cannot re-define a "verbose" option. But you can use "output()->isVerbose()" in your code instead.', $this->function); + } + $mode = $taskArgumentAttribute->mode; $defaultValue = $parameter->isOptional() ? $parameter->getDefaultValue() : null; diff --git a/src/ContextRegistry.php b/src/ContextRegistry.php index 6d62dbfb..a9aa48c4 100644 --- a/src/ContextRegistry.php +++ b/src/ContextRegistry.php @@ -19,7 +19,7 @@ public function addDescriptor(ContextDescriptor $descriptor): void if (\array_key_exists($name, $this->descriptors)) { $alreadyDefined = $this->descriptors[$name]->function; - throw new FunctionConfigurationException(sprintf('You cannot defined two contexts with the same name "%s". There is one already defined in "%s:%d".', $name, PathHelper::makeRelative((string) $alreadyDefined->getFileName()), $alreadyDefined->getStartLine()), $descriptor->function); + throw new FunctionConfigurationException(sprintf('You cannot define two contexts with the same name "%s". There is one already defined in "%s:%d".', $name, PathHelper::makeRelative((string) $alreadyDefined->getFileName()), $alreadyDefined->getStartLine()), $descriptor->function); } $this->descriptors[$name] = $descriptor;