Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ErrorRenderer] Add DebugCommand for easy debugging and testing #32504

Open
wants to merge 2 commits into
base: 4.4
from

Conversation

Projects
None yet
4 participants
@yceruto
Copy link
Member

commented Jul 11, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

debug-error-renderer

This command helps you test built-in renderers and others provided by third-party packages (thinking API-Platform, FOSRestBundle, etc.) without requiring the TwigBundle preview mechanism.

This also fixes a bug in ErrorRendererPass related to the order of priorities.

@yceruto yceruto force-pushed the yceruto:debug_command branch 4 times, most recently from 33b2036 to dc0f057 Jul 11, 2019

@yceruto yceruto added this to the next milestone Jul 11, 2019

@yceruto yceruto force-pushed the yceruto:debug_command branch from dc0f057 to dd2484a Jul 11, 2019

protected function configure(): void
{
$this
->addArgument('format', InputArgument::OPTIONAL, sprintf('Outputs a sample in a specific format (one of %s)', implode(', ', array_keys($this->renderers))))

This comment has been minimized.

Copy link
@fabpot

fabpot Jul 12, 2019

Member

Should be an option to be consistent with other commands.

This comment has been minimized.

Copy link
@yceruto

yceruto Jul 12, 2019

Author Member

Here "format" doesn't have the same meaning as in other commands. Other commands use the --format option to show the current information in another format, here the format argument shows a different information with a different meaning "Outputs an error sample in a specific format".

It could also be confusing because people would expect that with --format=json the list of available renderers in the specified format and that is not the case.

Do you think the description of the argument should be improved to make it clearer?

This comment has been minimized.

Copy link
@yceruto

yceruto Jul 12, 2019

Author Member

It is rather "I want to see an output of the error renderer associated with this format".

@yceruto yceruto force-pushed the yceruto:debug_command branch from 9f7054b to fc576d9 Jul 16, 2019

@yceruto

This comment has been minimized.

Copy link
Member Author

commented Jul 16, 2019

Thanks @ro0NL !

(Status: Needs Review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.