-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Display original definition for aliases in debug:container #21129
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
$serviceId = $options['id']; | ||
|
||
do { | ||
$serviceId = (string) $builder->getAlias($serviceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible to write data for each alias as well? So that if you have alias1 -> alias2 -> service
you see something along the lines of:
- alias1 is an alias for alias2
- alias2 is an alias for service
- <service description>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be indeed better but it doesn't look possible, AFAIK there's no way to handle chained aliases, it direct gives the original id.
Given alias1
is an alias of original
and, alias2
is an alias of alias1
, running debug:container alias2
currently gives
This service is an alias for the service "original",
and not
This service is an alias for the service "alias1"
:/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm ok, but then why is this looping necessary then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized this, it is useless :)
985af21
to
c919eab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a functional test for this change?
@@ -141,7 +141,7 @@ protected function write($content, $decorated = false) | |||
* @param Definition|Alias|object $service | |||
* @param array $options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PHPDoc must be updated (new arg)
@@ -168,7 +168,7 @@ protected function write($content, $decorated = false) | |||
* @param Alias $alias | |||
* @param array $options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -266,12 +275,15 @@ private function getContainerTagsDocument(ContainerBuilder $builder, $showPrivat | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
6d89444
to
8d78b8a
Compare
@dunglas Phpdoc fixed and test added. Thank you for the review. |
285bee8
to
86b7ec2
Compare
Tests are green |
86b7ec2
to
cd4b15e
Compare
Thank you @chalasr. |
…ses in debug:container (chalasr) This PR was merged into the 3.3-dev branch. Discussion ---------- [FrameworkBundle] Display original definition for aliases in debug:container | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20954 | License | MIT | Doc PR | n/a Before  After  <details> <summary>XML output</summary> Before  After  </details> <details> <summary>JSON output</summary> Before  After  </details> <details> <summary>Markdown output</summary> Before  After  </details> Commits ------- cd4b15e [FrameworkBundle] Display original definition for aliases in debug:container
Before

After

XML output
Before

After

JSON output
Before

After

Markdown output
Before

After
