ReflectionProperty('\Phalcon\Http\Cookie', 'restored') breaks on Phalcon 5.13+ (renamed to isRestored)
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- php
- 領域
- testing-qa
調査の方向性
Start in src/Codeception/Lib/Connector/Phalcon5.php at doRequest(), especially the ReflectionProperty usage around line 145. Reproduce through the Phalcon5 _request() path with a non-empty cookies service on Phalcon 5.12 and 5.13+, then verify that cookie synchronization completes without a ReflectionException on both versions.
索引モデルが issue の本文から書いたものです。
説明
Description
Codeception\Lib\Connector\Phalcon5::doRequest() uses reflection to read a protected restored property off Phalcon\Http\Cookie instances when syncing cookies back onto the simulated response:
$restoredProperty = new ReflectionProperty('\Phalcon\Http\Cookie', 'restored');
Phalcon renamed this property from restored to isRestored starting with Phalcon 5.13 (still named isRestored as of 5.20.3):
https://github.com/phalcon/cphalcon/blob/v5.20.3/phalcon/Http/Cookie.zep#L50
Any functional/acceptance test that dispatches a request through an app where the cookies DI service ends up with at least one entry now fails with:
ReflectionException: Property Phalcon\Http\Cookie::$restored does not exist
Steps to reproduce
- Use
codeception/module-phalcon5v2.0.1against a Phalcon app running Phalcon core>= 5.13(e.g. viaphalcon-sharedor any recentext-phalconbuild). - Dispatch any request through the
Phalcon5module's_request()(or a Codeception action built on it) where the app'scookiesservice has a non-emptycookiesarray by the time the response is built (e.g. because the session service was started during dispatch). - Observe the
ReflectionException.
Expected behavior
The connector should read whichever property name is correct for the installed Phalcon version, or simply use the public API (Phalcon\Http\Cookie doesn't appear to expose isRestored() publicly today - only getValue() triggers restore() internally) rather than reflecting into a specific protected property name.
Environment
codeception/module-phalcon5: v2.0.1 (latest on Packagist)- Phalcon core: 5.20.3 (via
phalcon/phalcon-sharedcompiled extension) - PHP: 8.3
Workaround
We're carrying a local Composer patch (via cweagans/composer-patches) that renames the reflected property from restored to isRestored, which is obviously not version-safe across Phalcon 5.12 vs 5.13+. Happy to open a PR if a version-tolerant approach (e.g. checking which property exists, or avoiding the private-property reflection entirely) would be welcome.
- 主要言語
- PHP
- スター
- 6
- フォーク
- 3
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeception/module-phalcon5 のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
Codeception/module-phalcon5#11 · コメント 2 件 ·
Codeception/module-phalcon5 の issue をすべて見る
似ている issue
-
status/awaiting_triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
WordPress/plugin-check#1486 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
az-digital/az_quickstart#6019 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
grokability/snipe-it#19688 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100