Skip to content

feat: EC-CUBE 4.4への対応#186

Merged
dotani1111 merged 9 commits into
EC-CUBE:4.4from
dotani1111:feat-4.4
Jun 4, 2026
Merged

feat: EC-CUBE 4.4への対応#186
dotani1111 merged 9 commits into
EC-CUBE:4.4from
dotani1111:feat-4.4

Conversation

@dotani1111

@dotani1111 dotani1111 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

概要

API プラグインを EC-CUBE 4.4 (Symfony 7.4 / Doctrine ORM 3.0 / PHP 8.2+) に対応させ、プラグインコードを Api44 に改名します。

変更内容

Api42 → Api44 改名 (ca91d86)

  • composer.json (name: ec-cube/api44 / code: Api44 / version: 4.4.0)、namespace、テンプレート参照、ドキュメントを一括改名

本体コードの 4.4 対応 (07151b9)

  • league/oauth2-server-bundle ^0.5 → ^1.1(Symfony 7 対応)。oauth2-server 9 で削除された CryptKey::RSA_KEY_PATTERN 相当をプラグイン側に定義
  • webonyx/graphql-php ^14 → ^15(^14 はセキュリティアドバイザリによりインストール不可)。getVisitor(QueryValidationContext): array / typed $name プロパティ / ClientAware::getCategory() 削除に追従
  • アノテーション → PHP 属性: @Route#[Route]@ORM\*#[ORM\*](ORM 3 はアノテーションマッピング自体が削除)、@required#[Required]
  • Sensio FrameworkExtraBundle 廃止対応: @Templaterender() 明示、@IsGranted#[IsGranted]
  • Symfony 7 で削除された API: loadUserByUsername()loadUserByIdentifier()$defaultName#[AsCommand]security.enable_authenticator_manager 設定削除
  • ORM 3 対応: flush($entity)flush()AssociationMapping::isToMany()
  • ApiCompilerPass で抽象クラスをコンテナ定義から除外(4.4 では抽象クラスもサービス定義に含まれるため)
  • OAuth 鍵生成時に private key を 0600 に設定
  • 未参照の UserPasswordEncoder を削除(Symfony 7 で削除済みの interface に依存)
  • php-cs-fixer(コア 4.4 設定)適用

テストの 4.4 / PHPUnit 11 対応 (8f84fbf)

  • data provider の static 化と #[DataProvider] 属性化
  • oauth2-server 9 の API 変更に追従(toString() / initJwtConfiguration())
  • Symfony 7 のバリデーションメッセージ変更に追従 ほか

CI 更新 (9032eb8)

  • EC-CUBE 4.4 / PHP 8.2-8.4 / MySQL 8.4 / PostgreSQL 14 のマトリクスに変更
  • actions/checkout@v4、GITHUB_OUTPUT 化、ubuntu-24.04

動作確認

  • eccube:plugin:installenabledisableuninstall 一巡 OK(EC-CUBE 4.4 + SQLite)
  • プラグインテスト 87件 / 221 アサーション 全パス(deprecation/notice ゼロ)
  • PHPStan level 1 クリーン
  • eccube:api:dump-schema で GraphQL スキーマ出力確認
  • コア側テスト(CartControllerTest / Admin ProductControllerTest)のリグレッションなし

既知の課題 / フォローアップ

  • php-http/message-factory(abandoned)依存の整理
  • docs サイトの 4.4 向け全面改訂

dotani1111 and others added 6 commits June 2, 2026 16:21
EC-CUBE 4.4 対応版として、プラグインコード・namespace・テンプレート参照・
ドキュメントの Api42/api42 を Api44/api44 に一括で改名する。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- league/oauth2-server-bundle を ^1.1 に更新し、削除された
  CryptKey::RSA_KEY_PATTERN 相当のパターンをプラグイン側に定義
- webonyx/graphql-php を ^15 に更新 (^14 はセキュリティアドバイザリにより
  インストール不可)。ValidationRule::getVisitor / ScalarType / ClientAware の
  API 変更に追従
- アノテーションを PHP 属性に移行 (@route → #[Route], @Orm\* → #[ORM\*],
  @required → #[Required])。ORM 3 はアノテーションマッピング自体が削除
- Sensio FrameworkExtraBundle の廃止に対応 (@template → render() 明示,
  @IsGranted → #[IsGranted])
- Symfony 7 で削除された API に追従 (loadUserByUsername →
  loadUserByIdentifier, Command の $defaultName → #[AsCommand],
  security.enable_authenticator_manager 設定の削除)
- ORM 3 対応 (flush($entity) → flush(), AssociationMapping::isToMany())
- ApiCompilerPass で抽象クラスをコンテナ定義から除外 (4.4 では抽象クラスも
  サービス定義に含まれるため)
- OAuth 鍵生成時に private key を 0600 に設定
- どこからも参照されない UserPasswordEncoder を削除 (Symfony 7 で削除済みの
  UserPasswordEncoderInterface に依存していた)
- php-cs-fixer (コア 4.4 設定) を適用

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- data provider を static 化し、@dataProvider を #[DataProvider] 属性に移行
- oauth2-server 9 の API 変更に追従 (__toString() → toString(),
  initJwtConfiguration() の明示呼び出し)
- ClientAware::getCategory() の削除に伴い isClientSafe() の検証に変更
- Symfony 7 のバリデーションメッセージ変更に追従
- WebHookServiceTest の Request import 誤り (Nyholm → Guzzle) を修正
- EccubeTestCase の tearDown と衝突しないようプロパティを nullable に変更

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- EC-CUBE 4.4 / PHP 8.2-8.4 のマトリクスに変更
- MySQL 8.4 / PostgreSQL 14 に更新 (4.4 のサポート DB に合わせ MySQL 5.7 を削除)
- actions/checkout@v4 へ更新、deprecated な set-output を GITHUB_OUTPUT に置き換え
- ubuntu-24.04 ランナーに更新

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- actions/checkout / setup-php / cache を本体と同じ SHA ピン留めに統一
- composer キャッシュを本体の composite action と同じ vendor ディレクトリ
  直キャッシュ方式に変更 (composer.lock ハッシュキー)
- setup-php に github-token: '' と redis 拡張を追加 (本体 unit-test と同設定)
- composer install に --dev を追加 (本体と同オプション)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PHPUnit 11 で廃止された <listeners> でDAMA DoctrineTestBundleを登録していたため
CIではトランザクションロールバックが効かず、テストごとに生成した商品データが
累積して "Multiple ProductClass found" でテストが失敗していた。

コア4.4のphpunit.xml.distに合わせて以下を更新:
- DAMA を <listeners> から <extensions><bootstrap> に変更 (PHPUnit 10+ 形式)
- <filter><whitelist> を <source> に変更
- スキーマを vendor の phpunit.xsd 参照に更新
- 廃止された SYMFONY_PHPUNIT_VERSION=9.5 固定を削除、env を server に統一

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dotani1111 dotani1111 changed the title Feat 4.4 EC-CUBE 4.4への対応 Jun 3, 2026
@dotani1111 dotani1111 changed the title EC-CUBE 4.4への対応 feat: EC-CUBE 4.4への対応 Jun 3, 2026
Comment thread .github/workflows/main.yml Outdated
Comment thread .github/workflows/main.yml Outdated
@ttokoro20240902

Copy link
Copy Markdown

・CodeRabbitを追加してください。
・「本 PR は fork 内での CI 確認用です。CI が安定したら EC-CUBE/eccube-api4 本体へ提出予定。」とありますが、EC-CUBE/eccube-api4 にPRされています。

EC-CUBE 4.4 本体の CI (unit-test.yml: PHP 8.2-8.5 / PostgreSQL 16) に合わせる。

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

dotani1111 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@ttokoro20240902

・CodeRabbitを追加してください。

追加いたいます。

・「本 PR は fork 内での CI 確認用です。CI が安定したら EC-CUBE/eccube-api4 本体へ提出予定。」とありますが、EC-CUBE/eccube-api4 にPRされています。

削除いたしました。

@dotani1111

Copy link
Copy Markdown
Contributor Author

@CodeRabbit
レビューお願いします。

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

@dotani1111 承知しました!PRのレビューを開始します。

(^・ω・^)ノ

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 45677fce-c02e-4e59-a78d-681c27609420

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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 and usage tips.

EC-CUBE 4.4 のシステム要件 (PostgreSQL 13〜18) に合わせる。
refs EC-CUBE/ec-cube#6762

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

dotani1111 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

@dotani1111 承知しました!PRのレビューを開始します。

(^・ω・^)ノ

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ttokoro20240902

Copy link
Copy Markdown

@dotani1111
lgtm

Comment thread GraphQL/Query/SingleResultQuery.php Outdated
Rector/cs-fixer が型なし PHPDoc から mixed を導出していたが、継承クラス
(OrderQuery/CustomerQuery/ProductQuery) は全て Entity の FQCN (string) を
渡しており、プロパティも string。実態に合わせて class-string に絞る。

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

@nanasess nanasess left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dotani1111

Copy link
Copy Markdown
Contributor Author

メモ

別PRとして、PHPStanの修正を行う余地あり。
手元で実行したところ、212件検出された。

@dotani1111 dotani1111 merged commit 783066e into EC-CUBE:4.4 Jun 4, 2026
9 checks passed
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.

3 participants