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

[3.3.] Nut debug tweaks #6543

Merged
merged 6 commits into from
Apr 6, 2017
Merged

[3.3.] Nut debug tweaks #6543

merged 6 commits into from
Apr 6, 2017

Conversation

GwendolenLynch
Copy link
Contributor

Mostly tweaks to allow different sorting, and a cople of table "pretty"

@GwendolenLynch GwendolenLynch added this to the Bolt 3.3 - Feature release milestone Apr 4, 2017
@@ -21,6 +23,7 @@ protected function configure()
$this
->setName('debug:events')
->setDescription('System events, and target callable debug dumper.')
->addOption('sort-listener', null, InputOption::VALUE_NONE, 'Sort events in order of listener name.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to have a sort option that can be given values like name, default, etc.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a look at the three … it only makes sense to give so many sort options, and this way is easy too, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so. In that case sort-name makes more sense. Same for service providers command.

'Path matching parameter',
'Method(s)',
[new TableCell('System routes', ['colspan' => 3])],
['Bind Name', 'Path Match Pattern', 'Method(s)']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bind Name - Maybe just Name? You call bind() to set the route name, and "bind" isn't used anywhere else.

Path Match Pattern - Maybe just Path? Symfony's referred to the path as pattern, but it is deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going for "Route Name" and "Path" then

$table->setHeaders([
'#',
'Provider',
[new TableCell('System service provider registration boot order', ['colspan' => 2])],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just Service Providers? You have a lot of extra words in there that don't mean anything :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WFM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, I guess it should be singular, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why, it is the title block for the service providers table.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you're right nvm.

'Listener',
));
$table->setHeaders([
[new TableCell('System events, and target callable', ['colspan' => 3])],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System events vs other kinds of events?

@@ -22,6 +25,7 @@ protected function configure()
$this
->setName('debug:services')
->setDescription('System service provider registration boot order debug dumper.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change the name to debug:providers or debug:service-providers? Individual services are not listed here. Also update the class name to match.

Description: Dumps service providers and their order.

'#',
'Provider',
[new TableCell('Service Providers', ['colspan' => 2])],
['Provider Class Name', 'Boot Order']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can Boot Order be changed to just Order? Order affects services registered, booted, event subscriptions, and controllers mounted.

* @param OutputInterface $output
*/
private function displayListeners(OutputInterface $output)
private function displayListeners(InputInterface $input, OutputInterface $output)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's with the separate method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gone now … copy/pasta

@GwendolenLynch
Copy link
Contributor Author

When we're happy, I'll rebase it all up.

Copy link
Member

@CarsonF CarsonF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would dump: be better than debug: for these?

@@ -20,7 +22,8 @@ protected function configure()
{
$this
->setName('debug:events')
->setDescription('System events, and target callable debug dumper.')
->setDescription('Events, and target callable, debug dumper.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dumps event listeners

@@ -20,7 +22,8 @@ protected function configure()
{
$this
->setName('debug:events')
->setDescription('System events, and target callable debug dumper.')
->setDescription('Events, and target callable, debug dumper.')
->addOption('sort-callable', null, InputOption::VALUE_NONE, 'Sort events in order of callable name.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sort-name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The column is the FQCN::method() of the event name being listener to

'Listener',
));
$table->setHeaders([
[new TableCell('Events, and target callable', ['colspan' => 3])],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Event Listeners

'Bind name',
'Path matching parameter',
'Method(s)',
[new TableCell('System routes', ['colspan' => 3])],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Routes

$this
->setName('debug:service-providers')
->setAliases(['debug:providers'])
->setDescription('System service provider registration boot order debug dumper.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dumps service providers and their order.

->setName('debug:service-providers')
->setAliases(['debug:providers'])
->setDescription('System service provider registration boot order debug dumper.')
->addOption('sort-class', null, InputOption::VALUE_NONE, 'Sort by provider class names.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sort-name

@GwendolenLynch
Copy link
Contributor Author

Would dump: be better than debug: for these?

I tossed that over with @bobdenotter, he pointed out that SF use debug: so we thought we'd go with that

->addOption('sort-pattern', null, InputOption::VALUE_NONE, 'Sort in order of URI patterns.')
->addOption('sort-methods', null, InputOption::VALUE_NONE, 'Sort in order of HTTP method grouping allowed.')
->addOption('sort-method', null, InputOption::VALUE_NONE, 'Sort in order of HTTP method grouping allowed.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where I was saying it seems to make more sense to have a value here instead of an option for each sorting. --sort name/path/method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but was thinking of consistency with the others

$rightAligned->setPadType(STR_PAD_LEFT);
$table->setHeaders([
[new TableCell('Event names, target callable listeners, and their priority', ['colspan' => 3])],
['Event Name', 'Callable', 'Priority'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first header is the exact same info as the second, no?

I think Listener would be better than Callable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got to get you to actually use some code one day …

$ ./app/nut debug:events
+-----------------------+---------------------------------------------------------------------------------------+--------------------+
| Event names, target callable listeners, and their priority                                                                         |
+-----------------------+---------------------------------------------------------------------------------------+--------------------+
| Event Name            | Callable                                                                              |           Priority |
+-----------------------+---------------------------------------------------------------------------------------+--------------------+
| kernel.request        | Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure()         |               2048 |
| kernel.request        | Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest()        |               1024 |
| kernel.request        | Bolt\EventListener\ConfigListener::onRequestEarly()                                   |                512 |

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know what it outputs. I meant it conveys the same information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is "event name", and "callable" (or "listener", which I don't agree with in this case) is conveying the exact same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've dropped the (first) title row and changed "Callable" to "Listener" … c.b.f 😉

@GwendolenLynch
Copy link
Contributor Author

Even added test coverage! #PR

@bobdenotter bobdenotter merged commit b5c3b4e into bolt:release/3.3 Apr 6, 2017
@GwendolenLynch GwendolenLynch deleted the hotfix/nut-debug-tweaks branch April 6, 2017 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants