phpstan: Class not found - case-insensitive caching of case-sensitive results
Bug report
Memoization in MemoizingReflectionProvider lowercases the classname before using it as the cache key. If you reference the class with an incorrect case, and it fails to be autoloaded, the provider caches it as ‘not found’. If it is then referenced with the correct casing the provider will not try to find it and report it as not found.
Code snippet that reproduces the problem
Assuming a case-sensitive autoloader that can find SomeClass but not someclass:
<?php
new someclass;
new SomeClass;
Output:
Instantiated class company not found. Instantiated class Company not found.
Expected output
Instantiated class someclass not found.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (11 by maintainers)
We could make it do that only if the ConstantStringType comes from
::class…