Skip to content

Commit a92b9a3

Browse files
committed
Fix quotes in exception messages
1 parent 9dc177d commit a92b9a3

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

Descriptor/ApplicationDescription.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function getCommands()
8888
public function getCommand($name)
8989
{
9090
if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) {
91-
throw new CommandNotFoundException(sprintf('Command %s does not exist.', $name));
91+
throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
9292
}
9393

9494
return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name];

Formatter/OutputFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function hasStyle($name)
119119
public function getStyle($name)
120120
{
121121
if (!$this->hasStyle($name)) {
122-
throw new InvalidArgumentException(sprintf('Undefined style: %s.', $name));
122+
throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name));
123123
}
124124

125125
return $this->styles[strtolower($name)];

Helper/Table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ private function fillNextRows(array $rows, $line)
460460
$unmergedRows = [];
461461
foreach ($rows[$line] as $column => $cell) {
462462
if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) {
463-
throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing __toString, %s given.', \gettype($cell)));
463+
throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', \gettype($cell)));
464464
}
465465
if ($cell instanceof TableCell && $cell->getRowspan() > 1) {
466466
$nbLines = $cell->getRowspan() - 1;

Question/ChoiceQuestion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private function getDefaultValidator()
155155
}
156156

157157
if (\count($results) > 1) {
158-
throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of %s.', implode(' or ', $results)));
158+
throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results)));
159159
}
160160

161161
$result = array_search($value, $choices);

Tests/Helper/QuestionHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ public function testSelectChoiceFromChoiceList($providedAnswer, $expectedValue)
524524
public function testAmbiguousChoiceFromChoicelist()
525525
{
526526
$this->expectException('InvalidArgumentException');
527-
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of env_2 or env_3.');
527+
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of "env_2" or "env_3".');
528528
$possibleChoices = [
529529
'env_1' => 'My first environment',
530530
'env_2' => 'My environment',
@@ -891,7 +891,7 @@ public function testLegacySelectChoiceFromChoiceList($providedAnswer, $expectedV
891891
public function testLegacyAmbiguousChoiceFromChoicelist()
892892
{
893893
$this->expectException('InvalidArgumentException');
894-
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of env_2 or env_3.');
894+
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of "env_2" or "env_3".');
895895
$possibleChoices = [
896896
'env_1' => 'My first environment',
897897
'env_2' => 'My environment',

Tests/Helper/TableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ public function testColumnStyle()
729729
public function testThrowsWhenTheCellInAnArray()
730730
{
731731
$this->expectException('Symfony\Component\Console\Exception\InvalidArgumentException');
732-
$this->expectExceptionMessage('A cell must be a TableCell, a scalar or an object implementing __toString, array given.');
732+
$this->expectExceptionMessage('A cell must be a TableCell, a scalar or an object implementing "__toString()", "array" given.');
733733
$table = new Table($output = $this->getOutputStream());
734734
$table
735735
->setHeaders(['ISBN', 'Title', 'Author', 'Price'])

0 commit comments

Comments
 (0)