Suggest assertNull() over assertSame(null, ...)
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #198 @alies-dev による — マージ済み
評価
調査の方向性
Start with the plugin’s afterMethodCallAnalysis hook and the existing test patterns for plugin issues; the issue gives no file paths. Check how the plugin reports and tests diagnostics, then add coverage for assertSame(null, ...) and assertNotSame(null, ...) with the suggested assertions. Done means the diagnostics recommend assertNull() and assertNotNull() respectively; a merged pull request already addresses this issue.
索引モデルが issue の本文から書いたものです。
説明
$this->assertSame(null, $value) works but reads worse and gives a less specific failure message than $this->assertNull($value).
phpstan-phpunit reports it (AssertSameNullExpectedRule).
Idea: in afterMethodCallAnalysis, when assertSame/assertNotSame is called with a literal null as the first argument, emit a plugin issue suggesting assertNull()/assertNotNull(). This and the similar assertSame(true|false, ...) and assertSame(n, count(...)) checks can share one helper. Roughly 40 lines with tests. Plugin issues can be suppressed per project by anyone who prefers the current style.
Idea borrowed from phpstan/phpstan-phpunit.
- 主要言語
- Gherkin
- スター
- 79
- フォーク
- 38
- 平均マージ
- 3時間 54分
- マージ済み PR(30日)
- 68
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
psalm/psalm-plugin-phpunit のほかの issue
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
psalm/psalm-plugin-phpunit#274 ·
メンテナーはふだん 1 日以内に返信
psalm/psalm-plugin-phpunit の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
radius-project/radius#13743 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Automattic/static-site-importer#2869 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
btclib-org/btclib#3047 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
freelawproject/courtlistener#8406 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
agentic-community/mcp-gateway-registry#2017 ·
メンテナーはふだん 1 日以内に返信