vimeo/psalm

ArgumentTypeCoercion instead of MixedArgumentTypeCoercion emitted

Open

#4,991 opened on Jan 12, 2021

View on GitHub
 (5 comments) (0 reactions) (0 assignees)PHP (668 forks)batch import
Help wantedbugeasy problemsgood first issue

Repository metrics

Stars
 (5,369 stars)
PR merge metrics
 (Avg merge 3d 12h) (5 merged PRs in 30d)

Description

If I understand correctly, MixedArgumentTypeCoercion is emitted when it's an iterable-specific issue, and ArgumentTypeCoercion is emitted in any other case. There are two ways to transform stdClass to an array: (array) $obj and get_object_vars($obj). In first case it will be a MixedArgumentTypeCoercion info, in the second case it will be ArgumentTypeCoercion error. https://psalm.dev/r/66737b481d

Looks like some inconsistency for me, or I can't understand some underlying logic.

Contributor guide