Repository navigation
Symfony7適合 - #59
Symfony7適合#59KenTanaka wants to merge 16 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
修正をお願いします。
e2e-testing.ymlは EC-CUBE4.2+ PHP 8.0、ab-testing.ymlは ec-cube の既定ブランチ(4.3)を checkout したまま*44のプラグインを入れる形になっています。44 は 4.4 / PHP 8.2+ 専用のため動きません。4.4 + Playwright 向けに直すか、4.4 ブランチから外してください。- 挙動を変えた次の 2 点に PHPUnit テストを追加してください(CI に PHPUnit を追加していますが、
Tests/には bootstrap しかありません)。CustomerTwoFactorAuthService::isAuthed():認証方式が未設定の会員は false を返す(!$x === nullの演算子優先順位の修正)CustomerTwoFactorAuthListener::onLoginSuccess():選択した認証方式が無効のときにログアウトへリダイレクトする(従来は戻り値が捨てられて効いていなかった)
@dotani1111 先のコメントで別 Issue とされた「ページ管理で編集したテンプレートが反映されない」件は、本 PR の #[Template] 変更が原因だったため、インラインで本 PR での修正をお願いしました(App・SMS も同様)。別 Issue は不要です。
| tar cvzf ../${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.tar.gz ./* | ||
| - name: Upload binaries to release of TGZ | ||
| uses: svenstaro/upload-release-action@v2 | ||
| uses: svenstaro/upload-release-action@v1-release |
There was a problem hiding this comment.
svenstaro/upload-release-action が @v2 から @v1-release に戻っています(f574c25「v2に更新」の巻き戻し)。意図した変更でなければ @v2 に戻してください。
| uses: svenstaro/upload-release-action@v1-release | |
| uses: svenstaro/upload-release-action@v2 |
| * @return array<string, mixed>|RedirectResponse | ||
| */ | ||
| #[Route(path: '/two_factor_auth/device_auth/input_onetime/{secret_key}', name: 'plg_customer_2fa_device_auth_input_onetime', requirements: ['secret_key' => '^[a-zA-Z0-9]+$'], methods: ['GET', 'POST'])] | ||
| #[Template('@TwoFactorAuthCustomer44/default/device_auth/input.twig')] |
There was a problem hiding this comment.
@TwoFactorAuthCustomer44/... 形式にしたため、テンプレートが app/template/plugin/{code} → プラグインの Resource/template の順で解決され、app/template/{theme} は見なくなります。その結果、copyTwigFiles() が配置するコピーと、ページ管理(dtb_page.file_name は旧形式のまま)での編集が画面に反映されません。店頭画面は従来どおり TwoFactorAuthCustomer44/Resource/template/default/... のパス形式で指定してください(L136、TwoFactorAuthCustomerController.php:49 も同様)。
概要
会員向け2段階認証プラグインを EC-CUBE 4.4(Symfony 7.4 / Doctrine ORM 3.0 / PHP 8.2+) に対応させ、コードを
TwoFactorAuthCustomer42→TwoFactorAuthCustomer44に改名します。4.3 とは非互換(属性必須・ORM 3・PHP 8.2+)のため、新規4.4ブランチへの取り込みです。参考: 4.3→4.4 マイグレーション手順 (doc #346) / 参照 Recommend-plugin #67
変更内容
1. EC-CUBE 4.4 対応(コア移行)
@ORM\*→#[ORM\*]、Controller の@Route/@Template→#[Route]/#[Template](Sensio依存除去)?int/?string/?\DateTime等)、ゲッター/セッター・各メソッドの戻り値型flush($entity)→flush()、QueryBuilder のsetParameters([...])→setParameter()へ変更(型付きパラメータ対応)enable/disableほか関連メソッドに: void@TwoFactorAuthCustomer44/...エイリアスへ統一phpunit.xml.distを<source>/<extensions>形式へ、Tests/bootstrap.phpを追加code/version: 4.4.0/ 管理画面ルートをTwoFactorAuthCustomer44に統一2. 静的解析・整形ツール
phpstan.neon.dist(level 6)/Resource/rector.php/Resource/.php-cs-fixer.dist.phpを追加(.php設定は本体のPlugin\:サービス検出で 500 を避けるためResource/配下に配置)3. CI(
.github/workflows/main.ymlほか)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 は未使用)cache:warmup: 有効プラグインのルートはコンテナのコンパイル時に確定するため、phpunit プロセスの遅延コンパイルだとRouteNotFoundExceptionが断続的に発生する問題を解消e2e-testing.yml/ab-testing.yml: 関連プラグインコードを*44(Customer / App / Sms)に更新release.yml: 配布パッケージから開発・テスト用ファイル(docker-compose / dockerbuild / CLAUDE.md / phpstan / rector / php-cs-fixer)を除外テスト
release.yml相当)から開発用ファイルが除外されることを確認