RTF Writer: Fix Header.php registerFont() not registering fonts/colors in subElements (such as textRuns)#2818
Open
rasamassen wants to merge 4 commits intoPHPOffice:masterfrom
Open
RTF Writer: Fix Header.php registerFont() not registering fonts/colors in subElements (such as textRuns)#2818rasamassen wants to merge 4 commits intoPHPOffice:masterfrom
rasamassen wants to merge 4 commits intoPHPOffice:masterfrom
Conversation
registerFont() registered fonts and colors from sections, but not from subparts of sections, such as textruns.
Author
|
I don't understand why this is failing the Static Analysis. I'm not sure what codebase you're using for that, but it sounds a lot like the issue described here: phpstan/phpstan#4579. I don't think this should be failing Static Analysis. |
At the point of errors, the variable must be an object because it passed the method_exists() test, but because the php static analysis tests didn't like the chance that it might return a string, let's explicitly cast the variable as an object.
rasamassen
added a commit
to rasamassen/PHPWord
that referenced
this pull request
Sep 3, 2025
Adds $listTable, getListTable(), writeListTable(), and registerListItem(). Also extends registerHeaderItem() to check if item is instanceof Numbering. Most functions empty for now. Work forthcoming. #NOTE: Changes registerFont() to registerHeader() and registerFontItem() to registerHeaderItem(). This will break pull request PHPOffice#2818, but is simply fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
registerFont() registered fonts and colors from sections, but not from subparts of sections, such as textruns.
Description
Now the header registers every font and color in a textRun. This is important if the fonts and colors are actually going to be used.
Fixes # (issue)
Checklist: