You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, create an alias named with class_alias through spl_autoload_register in bootstrap.
If there is an array with a different case from the alias before the point where the alias is used, an error will occur.(ex: Instantiated class PiyoAlias not found.)
Probably the fastest way to understand is to look at the commits in the link below.
I noticed this problem when I was using laravel.
Using laravel's facade feature, you may have this problem.
Code snippet that reproduces the problem
Paste the link to the repository because bootstrap is required
The isClassString method is called in the callerArrayForCallableTest method of the DependencyResolver class.
The isClassString calls MemoizingReflectionProvider's hasClass and stores the result with strtolower($className) as a key.
class_alias is case-sensitive, so no class will be found and false will be returned.
trying to new with an alias name, the result will be "Instantiated class PiyoAlias not found" because it is cached and not found.
i would like to fix it. but, code is complex for me and i don't have good idea.
The text was updated successfully, but these errors were encountered:
Bug report
First, create an alias named with class_alias through spl_autoload_register in bootstrap.
If there is an array with a different case from the alias before the point where the alias is used, an error will occur.(ex: Instantiated class PiyoAlias not found.)
Probably the fastest way to understand is to look at the commits in the link below.
I noticed this problem when I was using laravel.
Using laravel's facade feature, you may have this problem.
Code snippet that reproduces the problem
Paste the link to the repository because bootstrap is required
https://github.com/wim-web/phpstan-src/commit/aa19f495541e802c90b32a07ed9329ecaf72fdf9
Expected output
No Errors
Anticipated causes
da34d3f1d642d71d5a5130d371bb243c65b0b195
error has occurred from above commit.
The isClassString method is called in the callerArrayForCallableTest method of the DependencyResolver class.
The isClassString calls MemoizingReflectionProvider's hasClass and stores the result with
strtolower($className)
as a key.class_alias is case-sensitive, so no class will be found and false will be returned.
trying to new with an alias name, the result will be "Instantiated class PiyoAlias not found" because it is cached and not found.
i would like to fix it. but, code is complex for me and i don't have good idea.
The text was updated successfully, but these errors were encountered: