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

Appearance settings

[FrameworkBundle] use Table instead of the deprecated TableHelper #12970

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
Jan 5, 2015

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Dec 13, 2014

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

@fabpot
Copy link
Member

fabpot commented Dec 13, 2014

👍

$table->getStyle()->setCellHeaderFormat('%s');
}

$table->render();
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO the render method should also allow to pass the output as parameter (as it has been in TableHelper). It makes way more sense and then we don't need the protected getOutput method at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

The current way of passing the output as constructor to the Table object makes not much sense. The table object is just a representation of a table. And a table is not bound to the ouput, just the rendering is.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see your point. But shouldn't we move this discussion into a new issue?

@xabbuh
Copy link
Member Author

xabbuh commented Dec 29, 2014

Any other opinions on this?

@jakzal
Copy link
Contributor

jakzal commented Dec 29, 2014

Do we really need to keep the old renderTable() method? It's only used by the TextDescriptor and it's unlikely anyone derived from the Descriptor and relies on renderTable().

@xabbuh
Copy link
Member Author

xabbuh commented Dec 29, 2014

@jakzal To me it seems unlikely that someone relies on the existing method, but strictly speaking changing its signature would be a BC break. That's why I introduced the new method.

@jakzal
Copy link
Contributor

jakzal commented Dec 29, 2014

It would indeed be a BC break, but an allowed one. These classes are not part of the API. Given it's unlikely that anyone would rely on them, I don't think it would be a big deal to remove the old method. It is confusing to have renderTable() and renderConsoleTable().

@jakzal
Copy link
Contributor

jakzal commented Dec 29, 2014

We should at least deprecate the old method.

@xabbuh xabbuh force-pushed the replace-table-helper-usage branch 2 times, most recently from 4911e63 to 8372476 Compare December 29, 2014 17:29
@xabbuh
Copy link
Member Author

xabbuh commented Dec 29, 2014

Indeed, protected non-API methods are not guaranteed to be backward compatible. I removed renderConsoleTable(), changed the signature of renderTable() and added instructions to the upgrade file.

@fabpot
Copy link
Member

fabpot commented Dec 30, 2014

It's fine to break BC here in 2.7, but do we really want to do that in 2.5? I think that nobody should have relied on this part of the code, but I just want to raise the concern once more before merging.

@xabbuh
Copy link
Member Author

xabbuh commented Dec 30, 2014

@fabpot Do you want me to revert the last change and introduce the renderConsoleTable() method again? Or should we wait on the opinion of the other deciders?

@fabpot
Copy link
Member

fabpot commented Dec 30, 2014

I think that merging it as is is the way to go.

@saro0h
Copy link
Contributor

saro0h commented Jan 2, 2015

You have to fix tests (the lowest version of dependencies seems to be not ok).

@xabbuh xabbuh force-pushed the replace-table-helper-usage branch 2 times, most recently from b4b67ed to 4130bff Compare January 2, 2015 12:15
*
* @return OutputInterface The output
*/
protected function getOutput()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that changing the visibility of $output is enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changing the visibility makes it mutable. The methods allows us to keep the property read-only.

@xabbuh xabbuh force-pushed the replace-table-helper-usage branch from 4130bff to c5ad74d Compare January 2, 2015 12:44
@xabbuh
Copy link
Member Author

xabbuh commented Jan 2, 2015

@saro0h Thanks for the hint. I updated the dependencies to make the tests pass again.

@Tobion
Copy link
Contributor

Tobion commented Jan 2, 2015

👍

1 similar comment
@nicolas-grekas
Copy link
Member

👍

@fabpot
Copy link
Member

fabpot commented Jan 5, 2015

Thank you @xabbuh.

@fabpot fabpot merged commit c5ad74d into symfony:2.5 Jan 5, 2015
fabpot added a commit that referenced this pull request Jan 5, 2015
…bleHelper (xabbuh)

This PR was merged into the 2.5 branch.

Discussion
----------

[FrameworkBundle] use Table instead of the deprecated TableHelper

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

c5ad74d use Table instead of the deprecated TableHelper
@xabbuh xabbuh deleted the replace-table-helper-usage branch January 5, 2015 18:49
@fabpot
Copy link
Member

fabpot commented Jan 5, 2015

@xabbuh Can you make a PR for 2.6? Thanks.

@xabbuh
Copy link
Member Author

xabbuh commented Jan 5, 2015

@fabpot Of course, can you please merge the 2.5 branch into the 2.6 branch?

@xabbuh
Copy link
Member Author

xabbuh commented Jan 5, 2015

Never mind, I was able to rebase locally (see #13273).

fabpot added a commit that referenced this pull request Jan 5, 2015
…ed TableHelper (xabbuh)

This PR was merged into the 2.6 branch.

Discussion
----------

[2.6][FrameworkBundle] use Table instead of the deprecated TableHelper

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Changes on top of #12970 for the `2.6` branch.

Commits
-------

0bcb594 use Table instead of the deprecated TableHelper
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.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.