Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
249920f to7e71b96Compare| 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())); |
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.
We maybe want to be consistent wether we handle the debug or the non-debug case first.
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.
adjusted
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.
displaying useful info is more important than "consistency" here to me
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.
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); |
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.
this is unrelated and should be reverted - it can break scripts that parse the output
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.
Hopefully, such script should use the json or XML output, but yes, I still vote for reverting.
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.
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()))); |
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.
do we really need the ternary on this line?
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.
You are right we don't need the ternary. The array of services given for the Iterator is always filled. Will revert it.
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.
done
Tobion left a comment
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.
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 commentedMay 9, 2019
Thank you@jschaedl. |
…(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
Uh oh!
There was an error while loading.Please reload this page.
With this services config:
Executing
./bin/console debug:container my_service --show-arguments --env=devresulted inWith this fix the output changed to:
and with
./bin/console debug:container my_service --show-arguments --env=prod