Skip to content

Conversation

@HenkPoley
Copy link
Contributor

Add missing (built-in?) classes in Codebase->classlike_storage_provider using ReflectionClass.

Similar to \Psalm\Internal\Codebase\Scanner::convertClassesToFilePaths()

Should fix issue #11491.

## Summary
- add `ClassStringInterpreter` that loads class storage via reflection when class-like strings are encountered
- register interpreter plugin when initializing config
- remove stub for built-in `AssertionError`
- ensure plugin is initialised in new test

## Testing
- `vendor/bin/phpunit tests/DynamicClassInstantiationUsingAVariable.php`

------
https://chatgpt.com/codex/tasks/task_e_685bb97c0cf48328bea2cf6fc01d44e1

* Handle string class names via reflection
* Polished ClassStringInterpreter.php after remarks from `phpcs` and `psalm` itself.
* Various exceptions and errors that could arrive here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant