Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DebugBundle][VarDumper] Fix server dumper placeholder command #26955

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

Merged
merged 1 commit into from
May 1, 2018
Merged

[DebugBundle][VarDumper] Fix server dumper placeholder command #26955

merged 1 commit into from
May 1, 2018

Conversation

ogizanagi
Copy link
Contributor

@ogizanagi ogizanagi commented Apr 16, 2018

Q A
Branch? master
Bug fix? no, fixes a deprecation warning
New feature? no
BC breaks? no
Deprecations? no, fixes ones
Tests pass? yes
Fixed tickets #26944
License MIT
Doc PR N/A

This placeholder command was addressed in quite an unorthodox fashion and the following fix isn't really better, but I guess that's fine for an internal class.

As a reminder: this command aims to favor discoverability of the ServerDumpCommand when listing available commands and by exposing its definition so you can read about it by using --help. Execution hints about the debug.dump_destination config option required to wire the actual command.

That's the only command for which we're doing this, though. So better keep this placeholder or drop it?

@ogizanagi ogizanagi added this to the 4.1 milestone Apr 16, 2018
@ogizanagi ogizanagi changed the title [VarDumper] Fix server dumper placeholder command [DebugBundle][VarDumper] Fix server dumper placeholder command Apr 16, 2018
@fabpot
Copy link
Member

fabpot commented Apr 17, 2018

To answer your question, I would drop it.

{
private $replacedCommand;

public function __construct(DumpServer $server = null, array $descriptors = array())
Copy link
Contributor

Choose a reason for hiding this comment

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

"server" never used. Here for BC? Maybe add a comment about that fact?

Copy link
Contributor Author

@ogizanagi ogizanagi Apr 18, 2018

Choose a reason for hiding this comment

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

That's only an internal command, no BC implications here.
No, actually as described in the PR description, this is a placeholder command that matches the replaced command's constructor signature (ServerDumpCommand) so we can just swap the class when the ServerDumper service cannot be wired.

@chalasr
Copy link
Member

chalasr commented Apr 18, 2018

I like the intend (could apply to many places in core) but not sure it's worth the hassle.
👍 for dropping now and maybe open a discussion regarding all similar cases.

@nicolas-grekas
Copy link
Member

@ogizanagi lets drop then :)

@ogizanagi
Copy link
Contributor Author

ogizanagi commented Apr 29, 2018

When introducing the server dumper feature, I was pretty much +0 about this due to the uncommon way to achieve it, the first of its kind in the core AFAIK.
However as there is no more dedicated option for enabling the feature but relies on a special value for the debug.destination instead for the command to be available, it's really not easily discoverable. So I've changed my mind about it. I think it fulfills its purpose.

If the intent is approved and you think it could apply to some other places, I don't see any reason to remove it right now. It's internal anyway and pure DX, no hassle. I'd say let's give it a chance and remove it later if things start being more complicated. We'll see if the approach is worth it or not and if it can be applied to some other places (but right now I can't think about any similar case).

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Let's go with this. @ogizanagi convinced me (as much as I convinced him before ;) )

@nicolas-grekas
Copy link
Member

Thank you @ogizanagi.

@nicolas-grekas nicolas-grekas merged commit 60af39b into symfony:master May 1, 2018
nicolas-grekas added a commit that referenced this pull request May 1, 2018
…mand (ogizanagi)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[DebugBundle][VarDumper] Fix server dumper placeholder command

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no, fixes a deprecation warning
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no, fixes ones <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #26944 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This placeholder command was addressed in quite an unorthodox fashion and the following fix isn't really better, but I guess that's fine for an internal class.

_As a reminder: this command aims to favor discoverability of the `ServerDumpCommand` when listing available commands and by exposing its definition so you can read about it by using `--help`. Execution hints about the `debug.dump_destination` config option required to wire the actual command._

That's the only command for which we're doing this, though. So better keep this placeholder or drop it?

Commits
-------

60af39b [DebugBundle][VarDumper] Fix server dumper placeholder command
@ogizanagi ogizanagi deleted the fix/server_dumper_placeholder_command branch May 2, 2018 06:14
@alcohol
Copy link
Contributor

alcohol commented Jun 4, 2018

This did not fix it, see #27493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants