-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
PHPStan version: 12.3.0
Creating an ReflectionClass instance within a class method generated the following error:
Parameter #1 $argument of class ReflectionClass constructor expects
class-string<T of object>|T of object, string given. |
Example: https://phpstan.org/r/b99b2fa6-f633-4cb9-b034-85fe69e5fb2e
or
Parameter #1 $argument of class ReflectionClass constructor
expects |class-string<>, string given. |
Example: https://phpstan.org/r/1bf6b512-f082-4234-a344-c9d9711e0dcd
But if I pass a string directly, with a valid class name, it doesn't triggers an error:
Example: https://phpstan.org/r/68fef600-29f9-4775-aee2-8bb35c358224
Expected output
No error, because $argument is either a string containing the name of the class to reflect, or an object.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels