vimeo/psalm

ArgumentTypeCoercion instead of MixedArgumentTypeCoercion emitted

オープン

#4,991 opened on 2021/01/12

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)PHP (668 件のフォーク)batch import
Help wantedbugeasy problemsgood first issue

Repository metrics

Stars
 (5,369 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド