Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

ReflectionProperty('\Phalcon\Http\Cookie', 'restored') breaks on Phalcon 5.13+ (renamed to isRestored)

Đang mở
#12 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
testing-qa

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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:

https://github.com/Codeception/module-phalcon5/blob/2.0.1/src/Codeception/Lib/Connector/Phalcon5.php#L145

$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

  1. Use codeception/module-phalcon5 v2.0.1 against a Phalcon app running Phalcon core >= 5.13 (e.g. via phalcon-shared or any recent ext-phalcon build).
  2. Dispatch any request through the Phalcon5 module's _request() (or a Codeception action built on it) where the app's cookies service has a non-empty cookies array by the time the response is built (e.g. because the session service was started during dispatch).
  3. 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-shared compiled 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.

Ngôn ngữ chính
PHP
Star
6
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Codeception/module-phalcon5

Tất cả issue của Codeception/module-phalcon5

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.