Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
yceruto committed Jul 18, 2019
1 parent 0e70e6a commit ff5d5a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Symfony/Component/ErrorRenderer/Command/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function configure(): void
<info>php %command.full_name%</info>
Or outputs a sample in a specific format:
Or output a sample in a specific format:
<info>php %command.full_name% format</info>

Expand All @@ -77,15 +77,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
throw new InvalidArgumentException(sprintf('No error renderer found for format "%s". Known format are %s.', $format, implode(', ', array_keys($this->renderers))));
}

$exception = FlattenException::createFromThrowable(new \Exception('Something has intentionally gone wrong.'), 500, ['X-Debug' => false]);
$exception = FlattenException::createFromThrowable(new \Exception('This is a sample exception.'), 500, ['X-Debug' => false]);
$io->writeln($renderers[$format]->render($exception));
} else {
$tableRows = [];
foreach ($renderers as $format => $renderer) {
$tableRows[] = [sprintf('<fg=cyan>%s</fg=cyan>', $format), \get_class($renderer)];
}

$io->title('ErrorRenderer');
$io->title('Error Renderers');
$io->text('The following error renderers are available:');
$io->newLine();
$io->table(['Format', 'Class'], $tableRows);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public function testAvailableRenderers()
$this->assertEquals(0, $ret, 'Returns 0 in case of success');
$this->assertSame(<<<TXT
ErrorRenderer
=============
Error Renderers
===============
The following error renderers are available:
Expand All @@ -57,7 +57,7 @@ public function testFormatArgument()
{
"title": "Internal Server Error",
"status": 500,
"detail": "Something has intentionally gone wrong."
"detail": "This is a sample exception."
}
TXT
Expand Down

0 comments on commit ff5d5a4

Please sign in to comment.