vimeo/psalm

Prevent comparison of null

Open

#6,869 创建于 2021年11月9日

在 GitHub 查看
 (6 评论) (1 反应) (0 负责人)PHP (668 fork)batch import
Help wantedenhancement

仓库指标

Star
 (5,369 star)
PR 合并指标
 (平均合并 3天 12小时) (30 天内合并 5 个 PR)

描述

With code like https://psalm.dev/r/890c56e8d0 (or a more complicated equivalent) I think it's often easy to forget to consider the case where the variable is null.

It might be useful for Psalm to emit an issue to stop comparisons with nullable values, and force the programmer to handle the null explicitly as a special case.

贡献者指南