-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update documentation for Style::add*Style methods #1383
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
Methods `addFontStyle`, `addParagraphStyle`, `addLinkStyle`, `addNumberingStyle, `addTitleStyle`, and `setDefaultParagraphStyle` does allow `\PhpOffice\PhpWord\Style\AbstractStyle` to be passed as `Style::setStyleValues` checks for this on line 193.
Indeed, you are right. By fixing this you uncovered another issue. Can you check https://scrutinizer-ci.com/g/PHPOffice/PHPWord/inspections/80dcf145-3775-4219-a0f6-5fb9b4b0b59f/issues/files/src/PhpWord/Style.php?status=new&orderField=path&order=asc&honorSelectedPaths=0 and fix that as well? |
@troosan I have changed the documentation of |
@troosan I have also changed to allow |
great, have a look at https://scrutinizer-ci.com/g/PHPOffice/PHPWord/inspections/8c984226-7358-4649-b0ea-9241d9f7e08a/issues/files/src/PhpWord/Style.php?status=new&orderField=path&order=asc&honorSelectedPaths=0 |
src/PhpWord/Style.php
Outdated
public static function addTitleStyle($depth, $fontStyle, $paragraphStyle = null) | ||
{ | ||
if ($depth === null) { | ||
if ($depth === null || $depth === '' || $depth === 0) { |
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.
Could we just use empty($depth)
here? it would catch all these cases.
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, that would definitely be cleaner
@troosan Looks like php 5.3 travis CV fails during composer install here as on develop branch. |
indeed, it seems finding the dependencies for (and with) php 5.3 is consuming a lot of memory (1.5Gb). |
Description
Methods
addFontStyle
,addParagraphStyle
,addLinkStyle
,addNumberingStyle
,addTitleStyle
, andsetDefaultParagraphStyle
does allow\PhpOffice\PhpWord\Style\AbstractStyle
to be passed asStyle::setStyleValues
checks for this on line 193.Checklist:
composer run-script check --timeout=0
and no errors were reported