Skip to content

call static instead of self on protected method #1611

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
Apr 16, 2019

Conversation

zearg
Copy link

@zearg zearg commented Apr 9, 2019

Description

No linked issue.
When you want to extends PhpOffice\PhpWord\Shared\Html class, the protected method parseNode, will call "self::parseChildNodes" making the call parseNode useless in the new class. And prevent parseChildNodes from being customized in the new class.

The change made allows the parseNode method to look for parseChildNodes first in the newly created class

More concretely, you can now customize parseChildNodes by extending the Html class

Maybe we can do same thing with all static methods (replacing calls self:: by static::)

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.63% when pulling 2045e52 on zearg:develop into 1534dc2 on PHPOffice:develop.

@troosan troosan merged commit b190352 into PHPOffice:develop Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants