-
-
Notifications
You must be signed in to change notification settings - Fork 251
Open
Labels
Description
Environment
- PHP Version:
- 8.4
- DiscordPHP Version:
- 10.29.6
Description
My static analyser (PHPStan) fails with the following code:
$member->roles->any(fn() => true)Cannot call method any() on
array<Discord\Parts\Guild\Role>|(Discord\Helpers\ExCollectionInterface&iterable<Discord\Parts\Guild\Role>).
🪪 method.nonObject
Expected behavior
No error - this method can only return ExCollectionInterface&iterable<Role> so the call to any is type safe.
Additional context
There was mention of the proposed fix (removing the impossible type) causing issues with most IDEs and even intelliphense. See: #1430.