Skip to content

Feat 4.4 - #58

Open
KenTanaka wants to merge 16 commits into
EC-CUBE:mainfrom
KenTanaka:feat-4.4
Open

KenTanaka wants to merge 16 commits into
EC-CUBE:mainfrom
KenTanaka:feat-4.4

Conversation

@KenTanaka

Copy link
Copy Markdown
Collaborator

概要

会員向け2段階認証プラグインを EC-CUBE 4.4(Symfony 7.4 / Doctrine ORM 3.0 / PHP 8.2+) に対応させ、コードを TwoFactorAuthCustomer42TwoFactorAuthCustomer44 に改名します。4.3 とは非互換(属性必須・ORM 3・PHP 8.2+)のため、新規 4.4 ブランチへの取り込みです。

参考: 4.3→4.4 マイグレーション手順 (doc #346) / 参照 Recommend-plugin #67

変更内容

1. EC-CUBE 4.4 対応(コア移行)

  • Annotations → PHP 属性: Entity の @ORM\*#[ORM\*]、Controller の @Route/@Template#[Route]/#[Template]Sensio 依存除去)
  • 型宣言の明示: Entity プロパティの型付け(?int/?string/?\DateTime 等)、ゲッター/セッター・各メソッドの戻り値型
  • constructor property promotion / readonly: Controller 等の DI を現代化
  • Doctrine ORM 3.0: flush($entity)flush()、QueryBuilder の setParameters([...])setParameter() へ変更(型付きパラメータ対応)
  • AbstractPluginManager: enable/disable ほか関連メソッドに : void
  • テンプレート参照: パス文字列 / @TwoFactorAuthCustomer44/... エイリアスへ統一
  • PHPUnit 11: phpunit.xml.dist<source>/<extensions> 形式へ、Tests/bootstrap.php を追加
  • コード名: namespace / composer code / version: 4.4.0 / 管理画面ルートを TwoFactorAuthCustomer44 に統一
  • フォローアップ修正: Cookie 有効期限セッターの nullable 対応、Repository クエリパラメータ設定の修正

2. 静的解析・整形ツール

  • phpstan.neon.dist(level 6)/ Resource/rector.php / Resource/.php-cs-fixer.dist.php を追加(.php 設定は本体の Plugin\: サービス検出で 500 を避けるため Resource/ 配下に配置)
  • rector / php-cs-fixer を適用し、phpstan level 6 での検査を前提にした構成にする

3. CI(.github/workflows/main.yml ほか)

  • マトリクスを EC-CUBE 4.4 / PHP 8.2–8.5 / MySQL8・PostgreSQL に更新、checkout@v4$GITHUB_OUTPUT 化(MySQL 5.7・4.2/4.3 対象は除外)
  • プラグイン導入を eccube:plugin:install --path=... に変更(mock-package-api 依存を除去)し、PHPUnit 実行ステップを追加
  • --ignore-platform-req=ext-redis: Symfony 7.4 の symfony/cache が古い php-redis と衝突して本体 composer install が失敗するのを回避(redis は未使用)
  • phpunit 前に cache:warmup: 有効プラグインのルートはコンテナのコンパイル時に確定するため、phpunit プロセスの遅延コンパイルだと RouteNotFoundException が断続的に発生する問題を解消
  • static-analysis ジョブ: php-cs-fixer / rector / phpstan を SQLite・PHP 8.5 の1構成で実行
  • e2e-testing.yml / ab-testing.yml: 関連プラグインコードを *44(Customer / App / Sms)に更新
  • release.yml: 配布パッケージから開発・テスト用ファイル(docker-compose / dockerbuild / CLAUDE.md / phpstan / rector / php-cs-fixer)を除外

テスト

  • EC-CUBE 4.4 環境での手動試験(コミット記載どおり)
  • CI マトリクス: 4.4 × PHP 8.2/8.3/8.4/8.5 × MySQL8/PostgreSQL
  • 静的解析ジョブ: php-cs-fixer / rector dry-run / phpstan level 6
  • 配布パッケージ(release.yml 相当)から開発用ファイルが除外されることを確認

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ca8d0377-6771-4726-a5b9-3b392cb4d55e

✨ 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.

@dotani1111 dotani1111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

動作テストは問題ありませんでした。

@dotani1111

Copy link
Copy Markdown
Contributor

@KenTanaka
CI の失敗について、修正をお願いいたします。

おそらく、.github/workflows/main.ymleccube:plugin:installeccube:plugin:enableの間にbin/console cache:clear --no-warmupを戻していただければ解決するかと思われます。

全ジョブが enable で次の例外になっておりました。

The class 'Plugin\TwoFactorAuthCustomer44\Entity\TwoFactorAuthConfig' was not found
in the chain configured namespaces Eccube\Entity, Customize\Entity, ...

@dotani1111

Copy link
Copy Markdown
Contributor

またPR先は4.4ブランチ向けでお願いいたします。

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.

2 participants