tolerant-php-parser
tolerant-php-parser copied to clipboard
Unable to get resolved name for use clause name
Getting the resolved name of a use clause using QualifiedName#getResolvedName is explicitly disallowed and I am not sure why, it seems legitimate to me?
namespace SomeNamespace;
use Something\HelloTrait;
class Foobar
{
use HelloTrait;
}
$name->getResolvedName()
Expected: Something\HelloTrait
Actual: null.
I don't have a good answer... it seems like they should be resolved in a similar way to usages of the names. I'm not sure why that limitation is in place, but that API is used in a lot of places, so I'll have to think about it some more.
Good catch. Honestly, based on the blame / commit history - it looks like a hack that inadvertently got committed from when I was working on completions support. So removing it might break something with completions, but that something should probably be fixed in other ways :wink: