Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

debug:container --types (classes/interfaces)#22624

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@weaverryan
Copy link
Member

@weaverryanweaverryan commentedMay 3, 2017
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsnone, but needed insymfony/symfony-docs#7807
LicenseMIT
Doc PRn/a

In Symfony 3.3, thetype (i.e. class/interface) is the most important thing about a service. But, we don't have a way for the user to knowwhat types are available. This builds on top ofdebug:container to makedebug:container --types:

screen shot 2017-05-03 at 3 42 37 pm

I think we need this for 3.3, so I've made the diff assmall as possible. We could make improvements for 3.4, but justhaving this is the most important. I could even removeformat support to make the diff smaller.

This depends on#22385, which fixes a "bug" where private services aren't really shown.

Thanks!

robfrawley, linaori, chalasr, GuilhemN, and TomasVotruba reacted with thumbs up emoji
$tableRows =array();
foreach ($this->sortServiceIds($serviceIds)as$serviceId) {
$definition =$this->resolveServiceDefinition($builder,$serviceId);
$styledServiceId =sprintf('<fg=cyan>%s</fg=cyan>',$serviceId);
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This was an extra thing I snuck in to help prettify the output (see screenshot). I want the service id to "jump out" a bit more.

chalasr reacted with thumbs up emoji
@chalasr
Copy link
Member

The fact we havedebug:config anddebug:router makes thatdebug:types feels a bit unclear to me. Given that types are only about the container, couldn't this be an option ofdebug:container?--types would be consistent with the existing--parameters (and reduce the diff).

Also the main title saysSymfony Container Public and Private Services in the screenshot, I think havingTypes instead ofServices would be nice as a bonus.

ogizanagi and weaverryan reacted with thumbs up emoji

@weaverryanweaverryan changed the titleDebug command for type-hinting - debug:typesdebug:container --types (classes/interfaces)May 3, 2017
@weaverryan
Copy link
MemberAuthor

@chalasr Great suggestion! This is now simplydebug:container --types... which makes for a very simple diff indeed!


$tableHeaders =array_merge(array('Service ID'),$tagsNames,array('Class name'));
$tableRows =array();
$rawOutput =isset($options['raw_output']) &&$options['raw_output'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it rather beraw_text, or both maybe?

chalasr reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think you're right - i've updated it. I usedraw_output because that's what was used inAbstractDescriptorText. I've changed it toraw_output and updated that test to also requestraw_output. I don't know a ton about this area of the code.

<info>php %command.full_name% --filter=port</info>
EOF
)
Copy link
Member

Choose a reason for hiding this comment

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

This has been fixed meanwhile#22626

@nicolas-grekasnicolas-grekas added this to the3.3 milestoneMay 4, 2017
returnfalse;
}

returnclass_exists($serviceId) ||interface_exists($serviceId);
Copy link
Member

@nicolas-grekasnicolas-grekasMay 4, 2017
edited
Loading

Choose a reason for hiding this comment

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

interface_exists($serviceId, false); (no need to trigger autoload a 2nd time)

@weaverryan
Copy link
MemberAuthor

Updated!

Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍

@fabpot
Copy link
Member

Thank you@weaverryan.

@fabpotfabpot closed thisMay 4, 2017
fabpot added a commit that referenced this pull requestMay 4, 2017
This PR was squashed before being merged into the 3.3-dev branch (closes#22624).Discussion----------debug:container --types (classes/interfaces)| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | none, but needed insymfony/symfony-docs#7807| License       | MIT| Doc PR        | n/aIn Symfony 3.3, the *type* (i.e. class/interface) is the most important thing about a service. But, we don't have a way for the user to know *what* types are available. This builds on top of `debug:container` to make `debug:container --types`:<img width="1272" alt="screen shot 2017-05-03 at 3 42 37 pm" src="https://cloud.githubusercontent.com/assets/121003/25678671/8bebacaa-3018-11e7-9cf6-b7654e2cae88.png">I think we need this for 3.3, so I've made the diff as *small* as possible. We could make improvements for 3.4, but just *having* this is the most important. I could even remove `format` support to make the diff smaller.~~This depends on#22385, which fixes a "bug" where private services aren't really shown.~~Thanks!Commits-------25a39c2 debug:container --types (classes/interfaces)
@weaverryanweaverryan deleted the types-debug-command branchMay 4, 2017 18:43
weaverryan added a commit to symfony/symfony-docs that referenced this pull requestMay 5, 2017
This PR was merged into the master branch.Discussion----------Updates to DI config for 3.3Hi guys!WIP changes the new DI changes in 3.3! Woohoo! Some notes for myself:This relates to, oh, just these 10+ issues :). Assume they will all be closed by this one PR - before merge, if any of them aren't covered, I'll remove them.TODOS later (some might already be done)- update to use `debug:container --types` (symfony/symfony#22624)- update all other documents for possible changes for autowiring and autoconfigure- new page for existing Symfony users to explain the changes- update autowire section to talk about using aliases- document instanceof and also the ability to add configuration to the PSR4 loader- some links in the controller go to the API docs of `Controller`. But this is wrong, the methodsnow live in `ControllerTrait`... but the API docs for traits is basically broken:http://api.symfony.com/master/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.html- how should we pass a parameter to a controller?- do Twig extensions still need to be public? If so, the example in `service_container` about autoconfigure is still not quite rightDefinitely included in this PR*#7544*#7482*#7339*#7672Not included in this PR (but related to DI changes)*#7329*#7782*#7777*#7706*#7608*#7538*#7441*#7255* ~~#7041~~* ~~#7445~~* ~~#7444~~* ~~#7436~~Commits-------22adfbd removing duplicate target12c4944 Tweaks after amazing review from@GuilhemN and@xabbuhcac3c6c Merge remote-tracking branch 'origin/master' into di-3.3-changes2229fd3 Merge remote-tracking branch 'origin/master' into di-3.3-changes5452c61 Adding section about public: falseee27765 Adding versionaddedbc7088d Merge remote-tracking branch 'origin/di-3.3-changes' into di-3.3-changes443aec2 Merge pull request#7857 from GuilhemN/patch-189e12de bad link6de83e2 fixing build problem759e9b2 last tweaks from feedback45500b3 Adding details and usages of fetching the service as a controller arg70178d1 adding note about autoconfigure6e6ed94 more tweaks0e48bd8 [WIP] Updates to DI config for 3.39ab27f0 Add xml files2636bea bad linkc45daf4 fixing build problem9e84572 last tweaks from feedback049df7d Adding details and usages of fetching the service as a controller arg105801c adding note about autoconfigure2d11347 more tweaks8433fc1 [WIP] Updates to DI config for 3.3
@TomasVotruba
Copy link
Contributor

Beautiful work@weaverryan !

@fabpotfabpot mentioned this pull requestMay 17, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@ogizanagiogizanagiogizanagi left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

7 participants

@weaverryan@chalasr@fabpot@TomasVotruba@nicolas-grekas@ogizanagi@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp