[Console] Fix wrong exceptions being thrown
This commit is contained in:
parent
38bbb57bec
commit
28fca7c343
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Console\Helper;
|
||||
|
||||
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Console\Exception\LogicException;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
@ -53,7 +55,7 @@ class ProgressIndicator
|
||||
$indicatorValues = array_values($indicatorValues);
|
||||
|
||||
if (2 > count($indicatorValues)) {
|
||||
throw new \InvalidArgumentException('Must have at least 2 indicator value characters.');
|
||||
throw new InvalidArgumentException('Must have at least 2 indicator value characters.');
|
||||
}
|
||||
|
||||
$this->format = self::getFormatDefinition($format);
|
||||
@ -118,7 +120,7 @@ class ProgressIndicator
|
||||
public function start($message)
|
||||
{
|
||||
if ($this->started) {
|
||||
throw new \LogicException('Progress indicator already started.');
|
||||
throw new LogicException('Progress indicator already started.');
|
||||
}
|
||||
|
||||
$this->message = $message;
|
||||
@ -137,7 +139,7 @@ class ProgressIndicator
|
||||
public function advance()
|
||||
{
|
||||
if (!$this->started) {
|
||||
throw new \LogicException('Progress indicator has not yet been started.');
|
||||
throw new LogicException('Progress indicator has not yet been started.');
|
||||
}
|
||||
|
||||
if (!$this->output->isDecorated()) {
|
||||
@ -164,7 +166,7 @@ class ProgressIndicator
|
||||
public function finish($message)
|
||||
{
|
||||
if (!$this->started) {
|
||||
throw new \LogicException('Progress indicator has not yet been started.');
|
||||
throw new LogicException('Progress indicator has not yet been started.');
|
||||
}
|
||||
|
||||
$this->message = $message;
|
||||
|
@ -162,7 +162,7 @@ class Table
|
||||
} elseif (isset(self::$styles[$name])) {
|
||||
$this->columnStyles[$columnIndex] = self::$styles[$name];
|
||||
} else {
|
||||
throw new \InvalidArgumentException(sprintf('Style "%s" is not defined.', $name));
|
||||
throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name));
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
Reference in New Issue
Block a user