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

Skip to content

[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

Merged
merged 1 commit into from
Jun 22, 2015

Conversation

aitboudad
Copy link
Contributor

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.

$rows = $this->buildTableRows($this->rows);
$headers = $this->buildTableRows($this->headers);

$this->calculateColumnsWidth(array_merge($headers, $rows));
Copy link
Member

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.

Copy link
Contributor Author

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 ?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed

@nicolas-grekas
Copy link
Member

👍

@aitboudad aitboudad force-pushed the colspan_render_table branch from 51cac69 to b93bcc1 Compare June 20, 2015 19:04
@fabpot
Copy link
Member

fabpot commented Jun 22, 2015

Thank you @jaytaph.

@fabpot fabpot merged commit b93bcc1 into symfony:2.8 Jun 22, 2015
fabpot added a commit that referenced this pull request Jun 22, 2015
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
@aitboudad aitboudad deleted the colspan_render_table branch June 22, 2015 17:00
@fabpot fabpot mentioned this pull request Nov 16, 2015
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