Skip to content

fix(rector): AssertEqualsToSameRector の二重登録を削除#6936

Open
dotani1111 wants to merge 1 commit into
EC-CUBE:4.4from
dotani1111:fix/rector-remove-duplicate-assert-equals-to-same
Open

fix(rector): AssertEqualsToSameRector の二重登録を削除#6936
dotani1111 wants to merge 1 commit into
EC-CUBE:4.4from
dotani1111:fix/rector-remove-duplicate-assert-equals-to-same

Conversation

@dotani1111

@dotani1111 dotani1111 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

概要(Overview・Refs Issue)

rector.phpAssertEqualsToSameRector が二重に登録されていたため、明示登録側を削除します。

  • withRules()AssertEqualsToSameRector::class を明示登録している
  • 一方で withSets()PHPUnitSetList::PHPUNIT_CODE_QUALITYconfig/sets/phpunit-code-quality.php)にも同じルールが含まれている

セット側に含まれているため、明示登録は冗長です。

方針(Policy)

  • ルールの供給元をセット(PHPUNIT_CODE_QUALITY)に一本化し、設定の重複を解消する。
  • Rector は同一ルールを内部で重複排除するため、この変更による変換挙動の差はない(設定の可読性・意図の明確化が目的)。

実装に関する補足(Appendix)

  • 削除に伴い未使用となる use Rector\PHPUnit\CodeQuality\Rector\MethodCall\AssertEqualsToSameRector; も併せて削除。
  • PHPUNIT_CODE_QUALITY にルールが含まれることの根拠: vendor/rector/rector/vendor/rector/rector-phpunit/config/sets/phpunit-code-quality.php$rectorConfig->rules([...]) 内に AssertEqualsToSameRector::class)。

テスト(Test)

  • 設定ファイル(rector.php)のみの変更で、src / tests のコードには影響なし。
  • vendor/bin/rector process --dry-run --config=rector.php で変換結果が変わらないことを確認。

相談(Discussion)

特になし。

マイナーバージョン互換性保持のための制限事項チェックリスト

  • 既存機能の仕様変更はありません
  • フックポイントの呼び出しタイミングの変更はありません
  • フックポイントのパラメータの削除・データ型の変更はありません
  • twigファイルに渡しているパラメータの削除・データ型の変更はありません
  • Serviceクラスの公開関数の、引数の削除・データ型の変更はありません
  • 入出力ファイル(CSVなど)のフォーマット変更はありません

🤖 Generated with Claude Code

Summary by CodeRabbit

  • リファクタリング
    • 自動コード変換の設定を更新し、PHPUnitのassertEqualsassertSameへ自動変換しないようにしました。

- PHPUnitSetList::PHPUNIT_CODE_QUALITY セットに含まれるため withRules での明示登録は不要

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7e6b8828-4547-4008-9779-217803c2fd08

📥 Commits

Reviewing files that changed from the base of the PR and between 0186682 and b8ebe38.

📒 Files selected for processing (1)
  • rector.php
💤 Files with no reviewable changes (1)
  • rector.php

📝 Walkthrough

Walkthrough

Rector設定からAssertEqualsToSameRectorの参照とルール有効化が削除され、assertEqualsからassertSameへの自動変換が対象外になりました。

Changes

Rectorルール設定の削除

Layer / File(s) Summary
assertEquals変換ルールの除外
rector.php
AssertEqualsToSameRectoruse宣言とwithRules内の設定が削除されました。

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

うさぎが跳ねて、ルールはひとつ消えました
assertEqualsは静かに残りました
Rectorの箱もすっきり軽く
にんじん片手に設定を確認
月夜のコードが整いました

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは、AssertEqualsToSameRector の重複登録を削除した変更内容を的確に要約しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.78%. Comparing base (b90dee2) to head (b8ebe38).
⚠️ Report is 208 commits behind head on 4.4.

Additional details and impacted files
@@            Coverage Diff             @@
##              4.4    #6936      +/-   ##
==========================================
+ Coverage   75.21%   75.78%   +0.57%     
==========================================
  Files         493      545      +52     
  Lines       25005    27094    +2089     
==========================================
+ Hits        18808    20534    +1726     
- Misses       6197     6560     +363     
Flag Coverage Δ
Unit 75.78% <ø> (+0.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant