Incorrect resolution of assertInstanceOf with __NAMESPACE__ + string
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the Doctrine\Tests\DBAL\Functional\DataAccessTest case and reproduce the legacy assertInstanceOf(NAMESPACE.'\MyFetchClass', ...) example described in the issue. Trace how the PHPStan PHPUnit rule resolves the string and verify that the resulting class is Doctrine\Tests\DBAL\Functional\MyFetchClass rather than Doctrine\MyFetchClass.
Written by the indexing model from the issue text.
Description
Doctrine is using the following legacy format on some places:
self::assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]);
in a test located inside the Doctrine\Tests\DBAL\Functional\DataAccessTest test case.
The above incorrectly resolves as Doctrine\MyFetchClass instead of Doctrine\Tests\DBAL\Functional\MyFetchClass. Replacing with MyFetchClass::class is a workaround.
- Dominant language
- PHP
- Stars
- 544
- Forks
- 58
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 5
Contributor guide
No contributing guide indexed for this repository
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.
More from phpstan/phpstan-phpunit
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
phpstan/phpstan-phpunit#332 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
phpstan/phpstan-phpunit#321 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
phpstan/phpstan-phpunit#309 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
phpstan/phpstan-phpunit#299 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
phpstan/phpstan-phpunit#292 · 3 comments ·
All issues in phpstan/phpstan-phpunit
Similar issues
-
a11y admissions.uiowa.edu needs grooming SiteImprove best practice
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Save States Menu Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pluginsGLPI/datainjection#673 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
octobercms/october#6130 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
getgrav/grav-plugin-form#656 ·