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

[DI] Removes number of elements information in debug mode#31371

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

Merged
nicolas-grekas merged 1 commit intosymfony:3.4fromjschaedl:fix-issue-31340
May 9, 2019

Conversation

@jschaedl
Copy link
Contributor

@jschaedljschaedl commentedMay 3, 2019
edited
Loading

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#31340
LicenseMIT
Doc PR-

With this services config:

my_service:class:stdClassarguments:[!tagged my_tag]my_tagged_service_1:class:stdClasstags:[my_tag]my_tagged_service_2:class:stdClasstags:[my_tag]

Executing./bin/console debug:container my_service --show-arguments --env=dev resulted in

Informationfor Service"my_service"==================================== ---------------- -------------------------  Option           Value ---------------- -------------------------  Service ID       my_service  Class            stdClass  Tags             -  Public           no  Synthetic        no  Lazy             no  Shared           yes  Abstract         no  Autowired        yes  Autoconfigured   yes  Arguments        Iterator (0 element(s)) ---------------- -------------------------

With this fix the output changed to:

Informationfor Service"my_service"==================================== ---------------- ------------  Option           Value ---------------- ------------  Service ID       my_service  Class            stdClass  Tags             -  Public           no  Synthetic        no  Lazy             no  Shared           yes  Abstract         no  Autowired        yes  Autoconfigured   yes  Arguments        Tagged Iteratorfor"my_tag" ---------------- ------------

and with./bin/console debug:container my_service --show-arguments --env=prod

Informationfor Service"my_service_tagged_iterator"==================================================== ---------------- ---------------------------------------------  Option           Value ---------------- ---------------------------------------------  Service ID       my_service  Class            stdClass  Tags             -  Public           no  Synthetic        no  Lazy             no  Shared           yes  Abstract         no  Autowired        yes  Autoconfigured   yes  Arguments        Tagged Iteratorfor"my_tag" (2 element(s)) ---------------- ---------------------------------------------

@jschaedljschaedlforce-pushed thefix-issue-31340 branch 2 times, most recently from249920f to7e71b96CompareMay 3, 2019 10:21
@xabbuhxabbuh added this to the3.4 milestoneMay 4, 2019
if ($argumentinstanceof TaggedIteratorArgument) {
$argumentsInformation[] =sprintf('Tagged Iterator for "%s" %s',$argument->getTag(), !$options['is_debug'] ?sprintf('(%d element(s))',\count($argument->getValues())) :'');
}else {
$argumentsInformation[] =$options['is_debug'] ?'Iterator' :sprintf('Iterator (%d element(s))',\count($argument->getValues()));
Copy link
Member

Choose a reason for hiding this comment

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

We maybe want to be consistent wether we handle the debug or the non-debug case first.

jschaedl reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

adjusted

Choose a reason for hiding this comment

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

displaying useful info is more important than "consistency" here to me

Choose a reason for hiding this comment

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

displaying useful info is more important than "consistency" here to me

}
if ($argumentinstanceof Reference) {
$argumentsInformation[] =sprintf('Service(%s)', (string)$argument);
$argumentsInformation[] =sprintf('Service(%s)', (string)$argument);

Choose a reason for hiding this comment

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

this is unrelated and should be reverted - it can break scripts that parse the output

Copy link
Member

Choose a reason for hiding this comment

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

Hopefully, such script should use the json or XML output, but yes, I still vote for reverting.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

reverted

if ($argumentinstanceof TaggedIteratorArgument) {
$argumentsInformation[] =sprintf('Tagged Iterator for "%s"%s',$argument->getTag(),$options['is_debug'] ?'':sprintf(' (%d element(s))',\count($argument->getValues())));
}else {
$argumentsInformation[] =sprintf('Iterator%s',$options['is_debug'] ?'' :sprintf(' (%d element(s))',\count($argument->getValues())));

Choose a reason for hiding this comment

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

do we really need the ternary on this line?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

You are right we don't need the ternary. The array of services given for the Iterator is always filled. Will revert it.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@TobionTobion left a comment

Choose a reason for hiding this comment

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

We need to be careful when merging this to master due to#31353.
The is_debug option to the can be remove again I guess.

@nicolas-grekas
Copy link
Member

Thank you@jschaedl.

jschaedl reacted with hooray emoji

@nicolas-grekasnicolas-grekas merged commit0da4b83 intosymfony:3.4May 9, 2019
nicolas-grekas added a commit that referenced this pull requestMay 9, 2019
…(jschaedl)This PR was squashed before being merged into the 3.4 branch (closes#31371).Discussion----------[DI] Removes number of elements information in debug mode| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#31340| License       | MIT| Doc PR        | -With this services config:```yamlmy_service:    class: stdClass    arguments: [!tagged my_tag]my_tagged_service_1:    class: stdClass    tags: [my_tag]my_tagged_service_2:    class: stdClass    tags: [my_tag]```Executing `./bin/console debug:container my_service --show-arguments --env=dev` resulted in```bashInformation for Service "my_service"==================================== ---------------- -------------------------  Option           Value ---------------- -------------------------  Service ID       my_service  Class            stdClass  Tags             -  Public           no  Synthetic        no  Lazy             no  Shared           yes  Abstract         no  Autowired        yes  Autoconfigured   yes  Arguments        Iterator (0 element(s)) ---------------- -------------------------``` With this fix the output changed to:```bashInformation for Service "my_service"==================================== ---------------- ------------  Option           Value ---------------- ------------  Service ID       my_service  Class            stdClass  Tags             -  Public           no  Synthetic        no  Lazy             no  Shared           yes  Abstract         no  Autowired        yes  Autoconfigured   yes  Arguments        Tagged Iterator for "my_tag" ---------------- ------------```and with `./bin/console debug:container my_service --show-arguments --env=prod````bashInformation for Service "my_service_tagged_iterator"==================================================== ---------------- ---------------------------------------------  Option           Value ---------------- ---------------------------------------------  Service ID       my_service  Class            stdClass  Tags             -  Public           no  Synthetic        no  Lazy             no  Shared           yes  Abstract         no  Autowired        yes  Autoconfigured   yes  Arguments        Tagged Iterator for "my_tag" (2 element(s)) ---------------- ---------------------------------------------```Commits-------0da4b83 [DI] Removes number of elements information in debug mode
This was referencedMay 22, 2019
@jschaedljschaedl deleted the fix-issue-31340 branchFebruary 23, 2020 08:01
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofstof left review comments

@xabbuhxabbuhxabbuh approved these changes

+2 more reviewers

@ro0NLro0NLro0NL left review comments

@TobionTobionTobion approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

7 participants

@jschaedl@nicolas-grekas@stof@Tobion@ro0NL@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp