MutatingScope: implemented support for BitwiseNot operator#249
MutatingScope: implemented support for BitwiseNot operator#249dktapps wants to merge 2 commits intophpstan:masterfrom pmmp:bitwise-not
Conversation
ondrejmirtes
left a comment
There was a problem hiding this comment.
Best way to test this is to create a new dataProvider for NodeScopeResolverTest::testFileAsserts.
src/Analyser/MutatingScope.php
Outdated
There was a problem hiding this comment.
I assumed it was since other similar operators need it as well. I'll get rid of it.
src/Analyser/MutatingScope.php
Outdated
There was a problem hiding this comment.
Not covered cases:
- floats
- unions of constant strings
Best way to tackle this is to use TypeTraverse::map() which takes care of complex types easily...
There was a problem hiding this comment.
Floats get coerced to integer for bitwise not. I hadn't considered the union types problem.
There was a problem hiding this comment.
Oh right, floats work (but a unit test would be nice).
There was a problem hiding this comment.
The changed rule should be in separate commit along with the related test changes.
|
Merged as 24246f3, thank you. |
No description provided.