Skip to content

Commit

Permalink
Merge branch '4.4' into 5.0
Browse files Browse the repository at this point in the history
* 4.4:
  Fix quotes in exception messages
  Fix quotes in exception messages
  Fix quotes in exception messages
  • Loading branch information
fabpot committed Mar 16, 2020
2 parents 9cda41b + 20bc0c1 commit 2a8f012
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Descriptor/ApplicationDescription.php
Expand Up @@ -77,7 +77,7 @@ public function getCommands(): array
public function getCommand(string $name): Command
{
if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) {
throw new CommandNotFoundException(sprintf('Command %s does not exist.', $name));
throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
}

return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name];
Expand Down
2 changes: 1 addition & 1 deletion Formatter/OutputFormatter.php
Expand Up @@ -113,7 +113,7 @@ public function hasStyle(string $name)
public function getStyle(string $name)
{
if (!$this->hasStyle($name)) {
throw new InvalidArgumentException(sprintf('Undefined style: %s.', $name));
throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name));
}

return $this->styles[strtolower($name)];
Expand Down
2 changes: 1 addition & 1 deletion Helper/Table.php
Expand Up @@ -606,7 +606,7 @@ private function fillNextRows(array $rows, int $line): array
$unmergedRows = [];
foreach ($rows[$line] as $column => $cell) {
if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) {
throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing __toString, %s given.', \gettype($cell)));
throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', \gettype($cell)));
}
if ($cell instanceof TableCell && $cell->getRowspan() > 1) {
$nbLines = $cell->getRowspan() - 1;
Expand Down
2 changes: 1 addition & 1 deletion Question/ChoiceQuestion.php
Expand Up @@ -150,7 +150,7 @@ private function getDefaultValidator(): callable
}

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

$result = array_search($value, $choices);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Helper/QuestionHelperTest.php
Expand Up @@ -630,7 +630,7 @@ public function testSelectChoiceFromChoiceList($providedAnswer, $expectedValue)
public function testAmbiguousChoiceFromChoicelist()
{
$this->expectException('InvalidArgumentException');
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of env_2 or env_3.');
$this->expectExceptionMessage('The provided answer is ambiguous. Value should be one of "env_2" or "env_3".');
$possibleChoices = [
'env_1' => 'My first environment',
'env_2' => 'My environment',
Expand Down
2 changes: 1 addition & 1 deletion Tests/Helper/TableTest.php
Expand Up @@ -770,7 +770,7 @@ public function testColumnStyle()
public function testThrowsWhenTheCellInAnArray()
{
$this->expectException('Symfony\Component\Console\Exception\InvalidArgumentException');
$this->expectExceptionMessage('A cell must be a TableCell, a scalar or an object implementing __toString, array given.');
$this->expectExceptionMessage('A cell must be a TableCell, a scalar or an object implementing "__toString()", "array" given.');
$table = new Table($output = $this->getOutputStream());
$table
->setHeaders(['ISBN', 'Title', 'Author', 'Price'])
Expand Down

0 comments on commit 2a8f012

Please sign in to comment.