Call static method with static keyword instead of self in DefaultValueBinder#735
Call static method with static keyword instead of self in DefaultValueBinder#735midlan wants to merge 1 commit intoPHPOffice:developfrom midlan:develop
Conversation
|
Not sure about this. You can easily work around it by overriding @MarkBaker any opinion on this ? |
|
The easiest if your extending binder overrides is to call |
|
@PowerKiKi I would like to keep @MarkBaker I dont understand yours
Calling method with static doesn't mean the method must be implemented in it's childs. When calling method with static keyword, the parent method is called when local overriden is not implemented. Let's look on my example: https://www.tehplayground.com/kKvtHVz7qOLVk8PB |
|
I mean that if you extend |
MarkBaker
left a comment
There was a problem hiding this comment.
Approved, and once we move to PHP >= 7.1.0 we can modify the binder interface and return type hinting to help enforce this
|
Thanks for the contribution, I merged it |
This allow to avoid overriding `DefaultValueBinder::bindValue()` Fixes PHPOffice#735
This allow to avoid overriding `DefaultValueBinder::bindValue()` Fixes PHPOffice#735
When I extended
DefaultValueBinderand used my custom value binder, I overriden static methoddataTypeForValueto examine all cells as strings. But my method is not called, because inDefaultValueBinderit is called withselfkeyword. Since the class is designed to be extended (not final), I think the use ofselfkeyword is bad design, andstatickeyword should be used. When used withstatic, my overriden methoddataTypeForValueis called properly.Maybe same problem exists in other classes in project, but I only discovered this one.