Conversation
|
Ready to merge 👍 |
nikic
left a comment
There was a problem hiding this comment.
I don't think this change is correct. Outside a namespace we should still fully resolve to full qualified names. Unqualified names should only be left if resolution is impossible (due to global fallback) or because of special class names.
|
the verification of fully qualified already checked before check on line 114, so I think that's safe |
| new \Bar(); | ||
| \bar(); | ||
| \hi(); | ||
| bar(); |
There was a problem hiding this comment.
This is what I mean. This should resolve to a fully qualified name. The fact that it is equivalent to the unqualified name doesn't matter, we should always resolve fully if it is possible.
There was a problem hiding this comment.
if i understand correctly, the test is removing namespace, which no longer has namespace, means it doesn't have \\ prefix, next line to it, it have \bar which not changed as already fully qualified on the first place, which expexted.
There was a problem hiding this comment.
see line 124 which kept to have \\ prefix as it previously already fully qualified.
Ref https://getrector.com/ast/d50f4d493f7061f3c419397a744a49e92409c3ce?nodeId=1
which
\trueshould betrueon no namespace.