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

Skip to content

[FrameworkBundle] Fix services usages output for text descriptor #49849

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
Mar 31, 2023

Conversation

rmikalkenas
Copy link
Contributor

Q A
Branch? 6.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

If service is being used by lots of other services, the debug container command becomes unreadable, because Usages expands table. Replacing , separator with new line fixes this issue

@@ -361,7 +361,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
}

$inEdges = null !== $builder && isset($options['id']) ? $this->getServiceEdges($builder, $options['id']) : [];
$tableRows[] = ['Usages', $inEdges ? implode(', ', $inEdges) : 'none'];
$tableRows[] = ['Usages', $inEdges ? implode(\PHP_EOL, $inEdges) : 'none'];
Copy link
Member

@nicolas-grekas nicolas-grekas Mar 30, 2023

Choose a reason for hiding this comment

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

what about limiting to eg 3 and show "and X more" instead? I agree with you that the long output is useless

Copy link
Contributor Author

@rmikalkenas rmikalkenas Mar 30, 2023

Choose a reason for hiding this comment

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

@nicolas-grekas, I was thinking about it, but isn't it the main reason of debug command to clearly show the details about the resource?
Another option I thought was to implement a new command argument which would show usages (similar to show-arguments), but this would result to BC break, because by default it would no longer show usages..
IMO leaving all usages, but showing them in a single column is better (attaching screenshots of differences)
WDYT?

image
image

@fabpot
Copy link
Member

fabpot commented Mar 31, 2023

Thank you @rmikalkenas.

@fabpot fabpot merged commit bf65d7b into symfony:6.2 Mar 31, 2023
@fabpot fabpot mentioned this pull request Mar 31, 2023
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.

4 participants