EC-CUBE / EC-CUBE/ec-cube

残存する @deprecated public API の棚卸しと撤去方針の決定

Open
#6,938 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
PHP
Stars
788
Forks
719
Avg merge
4d 4h
Merged PRs (30d)
39

Description

## 背景

#6933 / #6937 で、**仕様(挙動・CSV等の出力・画面・スキーマ)を変えずに削除できる未使用の `@deprecated` public API** は撤去済み。
本 Issue は、**撤去すると仕様が変わる/利用実態が不明なため #6937 で据え置いた残りの `@deprecated`** を棚卸しし、それぞれ「撤去 / 移行設計 / 恒久維持」を裁定するためのもの。

前提として判明している事実:
- EC-CUBE 独自の `@deprecated` の**方針を明文化したドキュメントは存在しない**(`CONTRIBUTING.md` 等になし)。撤去タイミングを強制する仕組みもない。
- `@deprecated`(PHPDoc)は**実行時に `E_USER_DEPRECATED` を発火しない**ため、`max[direct]=0` ゲート(#6937)では捕捉されない。撤去は個別の設計判断が要る。
- 個々の意図は git 履歴(由来コミット/PR)から復元できる。以下はその復元結果。

## 残存する `@deprecated`(#6937 適用後)

| グループ | シンボル | 由来 | 現役の依存 | 想定される扱い |
|---|---|---|---|---|
| **税額系** | `Order::getTax()` / `setTax()` / `$tax`、`ItemHolderInterface::setTax()`、`Cart::setTax()` | PR #3900「add-deprecated」(2018-10) | 受注CSV「税金」列(`dtb_csv.csv`)・`PurchaseFlow.php` の税額集計・`dtb_order.tax` カラム | 「明細から算出」への**移行設計**が必要。7年間未実現。片手間撤去は不可 |
| **値引き** | `Order::getDiscount()` / `$discount` | `08153d0e82`「Order::getDiscountをdeprecatedに変更」(2019-08) | 受注CSV「値引き」列・`dtb_order.discount` カラム。代替 `getTaxableDiscount()` は別値 | 税額系と同様に移行設計が必要 |
| **php_path** | `BaseInfo::getPhpPath()` / `setPhpPath()` / `$php_path` | `de1c4028a1`「php_pathは使用していないためdeprecatedに修正」(2019-10) | `AuthenticationType` の `php_path` フォーム項目(描画テンプレートなし)・`base_info.php_path` カラム | フォーム項目除去+カラム削除マイグレーションで**撤去可能**(要マイグレーション) |
| **保守停止** | `ComposerProcessService`(クラス) | `f7ed93dc4f`「Add @deprecated」(2019-12) `Not maintained` | `app/config/eccube/services.yaml` にサービス登録あり | 利用実態の調査 → 撤去可否判断 |
| **デッド断片** | `DeliveryController.php:109` の `// @deprecated 使用されていないコード` | — | 遷移元チェックの fallback 分岐 | 到達性を確認し、真にデッドなら整理 |

## やること

1. 上記各グループについて、由来 PR/コミットと現役依存を確認のうえ「撤去 / 移行設計(別Issue化)/ 恒久維持」を裁定する。
2. **撤去可能なもの**(現状 `php_path` が最有力)は、仕様影響(フォーム・スキーマ)を明記して別 PR で撤去(要マイグレーション)。
3. **税額系・値引き**は、CSV 出力仕様と `dtb_order` カラムを保ったまま「明細集計へ移行」できるかの**設計 Issue を別途起票**(CSV 列の算出方法・後方互換・履歴データの扱いを含む)。
4. **`ComposerProcessService`** は利用実態を調査し、未使用なら撤去、使用中なら `@deprecated` の妥当性を再評価。

## 補足(再発防止の提案・任意)

「なぜ deprecated か分からない」を将来なくすため、**`@deprecated` には「理由・代替 API・撤去目標バージョン」を必ず書く**規約を `CONTRIBUTING.md` に追加することを別途検討したい(素の `@deprecated` を禁止)。

---
関連: #6933 / #6937

Contributor guide

Open the contributing guide

Research direction

Review the listed deprecated symbols, their originating PRs or commits, and current references in PurchaseFlow.php, dtb_csv.csv, app/config/eccube/services.yaml, AuthenticationType, and DeliveryController.php. Start by confirming each dependency and the reachability of the fallback branch. Done means every group has a documented removal, migration-design, or permanent-maintenance decision, with separate issues identified where required.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.