-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console][Table] allow multiple render() calls. #14991
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
Conversation
$rows = $this->buildTableRows($this->rows); | ||
$headers = $this->buildTableRows($this->headers); | ||
|
||
$this->calculateColumnsWidth(array_merge($headers, $rows)); |
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.
Instead of having this method change the state of the object, shouldn't we make it return $columnWidths? To me, the render() method would be better not mutating $this, if that makes sense.
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.
I'm not sure if it could change the state of the object as we call cleanup on each call https://github.com/aitboudad/symfony/blob/colspan_render_table/src/Symfony/Component/Console/Helper/Table.php#L571
we need to pass $columnWidths and $numberOfColumns to many methods ? does it make sense ?
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.
Indeed
👍 |
51cac69
to
b93bcc1
Compare
Thank you @jaytaph. |
This PR was merged into the 2.8 branch. Discussion ---------- [Console][Table] allow multiple render() calls. | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Fixed tickets | ~ | Tests pass? | yes | License | MIT This is a cherry-pick of #14983. Commits ------- b93bcc1 Fixed colspan issues with multiple render() calls
This is a cherry-pick of #14983.