microsoft / microsoft/tolerant-php-parser
Unable to get resolved name for use clause name
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 894
- Forks
- 85
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 3
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read src/Node/QualifiedName.php around line 87, then trace how getResolvedName handles names used in class trait clauses. The work is complete when the example's use-clause name returns Something\HelloTrait instead of null without breaking existing resolution behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100