Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflection error Anonymous Class not found #6681

Closed
bytestream opened this issue Feb 22, 2022 · 3 comments
Closed

Reflection error Anonymous Class not found #6681

bytestream opened this issue Feb 22, 2022 · 3 comments

Comments

@bytestream
Copy link

bytestream commented Feb 22, 2022

Bug report

Reflection error: AnonymousClasscf04ee4c9214a039fc48bfbed597493e not found.

Used to work OK in 0.x releases, error occurring since upgrading to ^1.0

Code snippet that reproduces the problem

https://phpstan.org/r/b9b7edfb-b47f-45e4-af09-b398a359e60d

Expected output

No errors

Did PHPStan help you today? Did it make you happy in any way?

❤️

@bytestream
Copy link
Author

Issue is the use of self inside the anonymous class:

$apiCacheMap = new class extends ApiCacheMap {
	protected const CACHE_MAP = [
-		1 => ApiCacheMap::CACHE_MAP[self::DEFAULT_CACHE_TTL], 
+		1 => ApiCacheMap::CACHE_MAP[ApiCacheMap::DEFAULT_CACHE_TTL],
	];
};

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@0e5d586 + ondrejmirtes/BetterReflection@96b1e4d

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants