更新差分へのレート差分表示 #946 でDRYに違反していた箇所の修正#1044
Merged
slime-hatena merged 2 commits intodevelopfrom Mar 14, 2026
Merged
Conversation
…yのgetLampForRatingを参照するように変更
Contributor
There was a problem hiding this comment.
Pull request overview
更新差分表示(#946)まわりで重複していた「レート計算用ランプ文字列(FB/FC/AB 等)の決定ロジック」を OngekiUtility に集約し、コピペ実装を解消するPRです(#1020 から切り分け)。
Changes:
OngekiUtilityにランプ文字列を返すgetLampForRatingを追加ViewUserRatingControllerでランプ判定の重複コードをユーティリティ呼び出しへ置換ViewUserProgressControllerで旧スコア側ランプ判定の重複コードをユーティリティ呼び出しへ置換(不要な計算行も削除)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| OngekiScoreLog/app/Services/OngekiUtility.php | ランプ文字列生成ロジックをメソッド化して共通化 |
| OngekiScoreLog/app/Http/Controllers/ViewUserRatingController.php | ランプ判定の重複コードを共通メソッド呼び出しへ置換 |
| OngekiScoreLog/app/Http/Controllers/ViewUserProgressController.php | 旧スコア側のランプ判定重複を共通化し、不要行も削除 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+238
to
+242
| public function getLampForRating(int $technicalScore, bool $fullBell, bool $fullCombo, bool $allBreak): string | ||
| { | ||
| if ($technicalScore == 1010000) { | ||
| if ($fullBell) { | ||
| return "FB/AB+"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1020 より切り分け