-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Visibility changes for PhpOffice\PhpSpreadsheet\Helper\Html breaks subclasses #3751
Comments
This is an issue that has arisen, and has not been acted on, before, e.g. see #3348 and especially #1682. Missing from those items is a use case to demonstrate why the visibility change would be helpful. You have provided one (using a different bulleting style than the default for lists), and it seems like a reasonable request. We could restore the visibility in order for you to achieve your aims. However, we could also just, say, add a property |
I do agree that the visibility for the methods/properties should not be restored. There is no handling for lists in the current implementation which is why we implemented our own solution. Another gap we discovered is handling for tables. We use Adding support for tables to the library would be nice, but I imagine there isn't going to be a "best" solution for how to render a table as text in a cell. One option that might work for allowing customization is implementing static methods for adding start or end tag callbacks as closures. \PhpOffice\PhpSpreadsheet\Helper\Html::addStartTagCallback('tr', function($stringData) {
return $stringData."\n\u{00A0}";
}
\PhpOffice\PhpSpreadsheet\Helper\Html::addEndTagCallback('table', function($stringData) {
return $stringData."\n";
} These closure callbacks would then be used in |
Fix PHPOffice#3751. User wants to add bullets for list items, and possibly handle table rows and other currently unsupported tags where one size might not fit all.
Let me know if #3752 meets your needs. |
Yes that solution will work. Thank you for the quick response! |
* Allow Users to Support Additional Tags in Helper/Html Fix #3751. User wants to add bullets for list items, and possibly handle table rows and other currently unsupported tags where one size might not fit all. * Update CHANGELOG.md
This is:
What is the expected behavior?
The properties/methods on the
PhpOffice\PhpSpreadsheet\Helper\Html
class were previously set as protected which allowed for implementing custom functionality via a child classes.What is the current behavior?
The visibility for the properties/methods was changed to private as part of #3080, breaking any child classes that were previously extending it.
What are the steps to reproduce?
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet versions >1.26.0
The text was updated successfully, but these errors were encountered: