8000 bug #18645 [Console] Fix wrong exceptions being thrown (JhonnyL) · symfony/symfony@f146f84 · GitHub
[go: up one dir, main page]

Skip to content

Commit f146f84

Browse files
bug #18645 [Console] Fix wrong exceptions being thrown (JhonnyL)
This PR was merged into the 2.8 branch. Discussion ---------- [Console] Fix wrong exceptions being thrown | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | | License | MIT | Doc PR | Commits ------- 28fca7c [Console] Fix wrong exceptions being thrown
2 parents 93a488b + 28fca7c commit f146f84

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Symfony/Component/Console/Helper/ProgressIndicator.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Console\Helper;
1313

14+
use Symfony\Component\Console\Exception\InvalidArgumentException;
15+
use Symfony\Component\Console\Exception\LogicException;
1416
use Symfony\Component\Console\Output\OutputInterface;
1517

1618
/**
@@ -53,7 +55,7 @@ public function __construct(OutputInterface $output, $format = null, $indicatorC
5355
$indicatorValues = array_values($indicatorValues);
5456

5557
if (2 > count($indicatorValues)) {
56-
throw new \InvalidArgumentException('Must have at least 2 indicator value characters.');
58+
throw new InvalidArgumentException('Must have at least 2 indicator value characters.');
5759
}
5860

5961
$this->format = self::getFormatDefinition($format);
@@ -118,7 +120,7 @@ public function getCurrentValue()
118120
public function start($message)
119121
{
120122
if ($this->started) {
121-
throw new \LogicException('Progress indicator already started.');
123+
throw new LogicException('Progress indicator already started.');
122124
}
123125

124126
$this->message = $message;
@@ -137,7 +139,7 @@ public function start($message)
137139
public function advance()
138140
{
139141
if (!$this->started) {
140-
throw new \LogicException('Progress indicator has not yet been started.');
142+
throw new LogicException('Progress indicator has not yet been started.');
141143
}
142144

143145
if (!$this->output->isDecorated()) {
@@ -164,7 +166,7 @@ public function advance()
164166
public function finish($message)
165167
{
166168
if (!$this->started) {
167-
throw new \LogicException('Progress indicator has not yet been started.');
169+
throw new LogicException('Progress indicator has not yet been started.');
168170
}
169171

170172
$this->message = $message;

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function setColumnStyle($columnIndex, $name)
162162
} elseif (isset(self::$styles[$name])) {
163163
$this->columnStyles[$columnIndex] = self::$styles[$name];
164164
} else {
165-
throw new \InvalidArgumentException(sprintf('Style "%s" is not defined.', $name));
165+
throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name));
166166
}
167167

168168
return $this;

0 commit comments

Comments
 (0)
0