Fix TypeUtils::getDirectClassNames for nested type#1380
Fix TypeUtils::getDirectClassNames for nested type#1380ondrejmirtes merged 5 commits intophpstan:1.7.xfrom
Conversation
c1621c7 to
e2444d3
Compare
e5cb2ef to
bb4823d
Compare
ef5ebfd to
00ace67
Compare
|
Do you know you can run the code locally too, righr? ;) |
b435d37 to
7549ae9
Compare
7549ae9 to
20596c6
Compare
yes, I know, I located the issue on my project and then hoped I will need less pushes here for the repro :) |
|
now the issue is fixed incl. full & simple functional test - can you please merge and tag a new release? |
src/Type/TypeUtils.php
Outdated
There was a problem hiding this comment.
This extension is too complicated. Can you just write a simple one just so we can verify it's actually executed? So we can see the method's return type isn't used but the one returned from an extension?
There was a problem hiding this comment.
this is the simplest impl. supporting unlimited nesting, please merge this test case as is
There was a problem hiding this comment.
The fixed issue can be demonstrated with a much simpler extension. Let's say you're writing an extension for a method that has string return type, the extension can just return new IntegerType() and we can assert that int has been used.
There was a problem hiding this comment.
the issue was limited nesting support of union/intersect
This test does support unlimited nesting - it removes virtual interface and reresolves $this/static. I do not think this two needed operations can be further simplified.
There was a problem hiding this comment.
Alright, had to do it myself :P 26d8fde
I verified the test fails without the change in TypeUtils.
81b7c93 to
26d8fde
Compare
|
Thanks. |
fixes phpstan/phpstan#7344
needed for atk4/data#932