Skip to content

Commit 20bc0c1

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Fix quotes in exception messages
2 parents 3c065ed + a92b9a3 commit 20bc0c1

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

Descriptor/ApplicationDescription.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getCommands(): array
7777
public function getCommand(string $name): Command
7878
{
7979
if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) {
80-
throw new CommandNotFoundException(sprintf('Command %s does not exist.', $name));
80+
throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
8181
}
8282

8383
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
@@ -115,7 +115,7 @@ public function hasStyle($name)
115115
public function getStyle($name)
116116
{
117117
if (!$this->hasStyle($name)) {
118-
throw new InvalidArgumentException(sprintf('Undefined style: %s.', $name));
118+
throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name));
119119
}
120120

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

Helper/Table.php

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

Question/ChoiceQuestion.php

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

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

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

Tests/Helper/QuestionHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ public function testSelectChoiceFromChoiceList($providedAnswer, $expectedValue)
630630
public function testAmbiguousChoiceFromChoicelist()
631631
{
632632
$this->expectException('InvalidArgumentException');
633-
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of env_2 or env_3.');
633+
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of "env_2" or "env_3".');
634634
$possibleChoices = [
635635
'env_1' => 'My first environment',
636636
'env_2' => 'My environment',

Tests/Helper/TableTest.php

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

0 commit comments

Comments
 (0)