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

Skip to content

[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

Merged
merged 1 commit into from
Jan 4, 2017

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Jan 2, 2017

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
before-txt

After
after-txt

XML output

Before
before-xml

After
after-xml

JSON output

Before
before-json

After
after-json

Markdown output

Before
before-md

After
after-md

@chalasr chalasr changed the title [FrameworkBundle] Display original definition for aliases in debug:co… [FrameworkBundle] Display original definition for aliases in debug:container Jan 2, 2017
Copy link
Contributor

@theofidry theofidry left a 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);
Copy link
Contributor

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>

Copy link
Member Author

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"

:/

Copy link
Contributor

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?

Copy link
Member Author

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 :)

@chalasr chalasr force-pushed the better-describe-aliases branch 3 times, most recently from 985af21 to c919eab Compare January 2, 2017 12:44
@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Jan 2, 2017
Copy link
Member

@dunglas dunglas left a 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
Copy link
Member

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
Copy link
Member

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
*
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

@chalasr chalasr force-pushed the better-describe-aliases branch 4 times, most recently from 6d89444 to 8d78b8a Compare January 3, 2017 11:39
@chalasr
Copy link
Member Author

chalasr commented Jan 3, 2017

@dunglas Phpdoc fixed and test added. Thank you for the review.
Builds failures are unrelated.

@chalasr chalasr force-pushed the better-describe-aliases branch 3 times, most recently from 285bee8 to 86b7ec2 Compare January 4, 2017 10:45
@chalasr
Copy link
Member Author

chalasr commented Jan 4, 2017

Tests are green

@chalasr chalasr force-pushed the better-describe-aliases branch from 86b7ec2 to cd4b15e Compare January 4, 2017 13:20
@fabpot
Copy link
Member

fabpot commented Jan 4, 2017

Thank you @chalasr.

@fabpot fabpot merged commit cd4b15e into symfony:master Jan 4, 2017
fabpot added a commit that referenced this pull request Jan 4, 2017
…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
![before-txt](http://image.prntscr.com/image/b0cb59f23ddb43669ba0aba093f454af.png)

After
![after-txt](http://image.prntscr.com/image/adf234957acf444292e45bded8efb9d8.png)

<details>
<summary>XML output</summary>

Before
![before-xml](http://image.prntscr.com/image/66212d92db654f88b8196b211046bcf2.png)

After
![after-xml](http://image.prntscr.com/image/3f6b5f9f1ea54a31aea36de5928b6ae9.png)
</details>

<details>
<summary>JSON output</summary>

Before
![before-json](http://image.prntscr.com/image/a7ffc4bcda61486f90af85c90e3d6caa.png)

After
![after-json](http://image.prntscr.com/image/15d0f37e78354dcf8e3015b94fcbdaed.png)

</details>

<details>
<summary>Markdown output</summary>

Before
![before-md](http://image.prntscr.com/image/be5289840ac64a5e80f11748f481686c.png)

After
![after-md](http://image.prntscr.com/image/cba4217863f647e9974e1715812eda01.png)
</details>

Commits
-------

cd4b15e [FrameworkBundle] Display original definition for aliases in debug:container
@chalasr chalasr deleted the better-describe-aliases branch January 4, 2017 13:27
@fabpot fabpot mentioned this pull request May 1, 2017
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.

6 participants