Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#12 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
testing-qa

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
PHP
Stelle
6
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Codeception/module-phalcon5

Tutte le issue di Codeception/module-phalcon5

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.