Skip to content

[NFR]: cphalcon - phalcon alignment #17055

@niden

Description

@niden

Deep analysis reveals just above 100 divergences between cphalcon v5 and phalcon v6.

This is a tracking issue.

cphalcon vs phalcon Deep Dive: 120 Divergences

Acl

  • DIV 1: dropComponentAccess BUG in cphalcon (string arg silently ignored)
  • DIV 2: fireManagerEvent call in isAllowed (cphalcon passes this as data, phalcon passes null)
  • DIV 3: description default value in Component/Role (null vs '', return type string|null vs string)
  • DIV 4: isAllowed parameters default (null vs [])
  • DIV 5: accessGranted assignment when no access found (null vs false)
  • DIV 6: activeKey when canAccess returns false (raw false vs converted to null)
  • DIV 7: ReflectionType check in isAllowed (cphalcon adds instanceof ReflectionNamedType)
  • DIV 8: Access storage type in allowOrDeny (int vs bool)
  • DIV 9: Property name func vs functions
  • DIV 10: allowOrDeny validation approach (inline vs extracted method)
  • DIV 11: EventsAwareTrait::setEventsManager extra container logic (cross-cutting)
  • DIV 12: EventsAwareTrait has firePsrEvent method (cross-cutting)

Application

  • DIV 13: getModule exception type (ModuleNotRegistered vs generic Exception)
  • DIV 14: __construct accepts Container\Collection in phalcon only
  • DIV 15: __construct null handling (cphalcon preserves existing, phalcon always overwrites)

Assets

  • DIV 16: Asset::throwException exception type (CannotReadAsset vs generic)
  • DIV 17: Manager::get exception type (CollectionNotFound vs generic)
  • DIV 18: Manager missing exists() deprecated method in phalcon
  • DIV 19: Manager::output exception types (6 granular missing in phalcon)
  • DIV 20: Manager::processParameters missing helper->reset() in phalcon

Autoload

  • DIV 21: Array key hashing -- MAJOR (cphalcon: plain string keys; phalcon: sha256 hash keys)
  • DIV 22: setFileCheckingCallback validation (cphalcon validates callable, phalcon accepts any string)
  • DIV 23: checkDirectories validation (LoaderDirectoriesNotArray vs TypeError)
  • DIV 24: setFileCheckingCallback null closure signature (1 param vs 0 params)

Cache

  • DIV 25: Event cancellable flag (cphalcon false, phalcon true)
  • DIV 26: Event/key-check ordering inconsistency -- BOTH SIDES
  • DIV 27: checkKey exception type (InvalidCacheKey vs InvalidArgumentException)
  • DIV 28: checkKeys method missing in phalcon (uses iterable type hint instead)
  • DIV 29: doGetMultiple Redis detection (instanceof vs exact class name)
  • DIV 30: getExceptionClass abstract method missing in phalcon

Cli

  • DIV 31: Console::setArgument --key=val=other BUG in phalcon (explode loses values after 2nd =)
  • DIV 32: Console::handle exception types (4 granular missing)
  • DIV 33: Console::handle router method name (getParameters vs getParams)
  • DIV 34: Console::handle Container type awareness (acceptable)

Config

  • DIV 35: Config::merge exception for invalid input (InvalidMergeData vs TypeError)
  • DIV 36: Config::setPathDelimiter null acceptance (cphalcon allows null, phalcon doesn't)
  • DIV 37: Config/Adapter/Ini exception type (CannotLoadConfigFile vs generic)
  • DIV 38: Config/Adapter/Yaml exception types (MissingYamlExtension, CannotLoadConfigFile vs generic)
  • DIV 39: Config/Adapter/Json JSON error handling (cphalcon Decode helper throws, phalcon json_decode swallows)
  • DIV 40: Config/Adapter/Grouped insensitive flag propagation (cphalcon propagates, phalcon doesn't)
  • DIV 41: ConfigFactory exception types (3 granular missing)
  • DIV 42: ConfigFactory::newInstance Grouped adapter default (cphalcon passes null, phalcon defaults 'php')

Contracts

  • DIV 43: Contracts/Db/Column missing getComment() in cphalcon
  • DIV 44: Contracts/Db/Column::getTypeValues return type (array|string vs array|string|int)
  • DIV 45: Contracts/Db/Dialect missing listViews() in cphalcon
  • DIV 46: Contracts/Db/Dialect::dropTable schemaName required vs optional
  • DIV 47: Contracts/Db/Result::fetchAll parameter count (0 vs 3)
  • DIV 48: Contracts/Db/Result::fetchArray return type (var vs array)

Db

  • DIV 49: Db/Adapter/AbstractAdapter::insert exception types (2 granular missing)
  • DIV 50: Db/Adapter/AbstractAdapter::setup static method missing in phalcon
  • DIV 51: Db/Adapter/AbstractAdapter::createTable exception (TableMustHaveColumn vs generic)
  • DIV 52: Db/Column missing processColumnType in cphalcon

Di

  • DIV 53: Di::get afterServiceResolve event can REPLACE instance -- MAJOR (phalcon captures return, cphalcon doesn't)
  • DIV 54: Di::get instance check after beforeServiceResolve (=== null vs !is_object())
  • DIV 55: Di exception types (ServiceCannotBeResolved, CircularAliasReference, etc.)
  • DIV 56: Di ArrayAccess methods (inline vs DiArrayAccessTrait)
  • DIV 57: Di loadFromPhp/loadFromYaml/loadFromConfig (inline vs DiLoadTrait)

Events -- MAJOR DIVERGENCE (B1: port cphalcon to phalcon)

  • DIV 58: Events\Manager -- entirely different implementations (1129 vs 493 lines)
  • DIV 59: fire() with no-colon event names (cphalcon throws, phalcon tries PSR-14 dispatch)
  • DIV 60: fire() response reentrancy (cphalcon stashes/restores, phalcon clobbers)
  • DIV 61: fireQueue visibility (public vs final protected)

Dispatcher

  • DIV 62: AbstractDispatcher handler hook caching (cphalcon caches, phalcon doesn't)
  • DIV 63: AbstractDispatcher handleException/throwDispatchException (dynamic calls in cphalcon)
  • DIV 64: DispatcherInterface method naming (getParameter/getParameters vs getParam/getParams)

Encryption

  • DIV 65: Crypt::isValidDecryptLength strlen vs mb_strlen -- BUG in phalcon
  • DIV 66: Crypt exception types (10+ granular missing)
  • DIV 67: Crypt::decrypt hash length caching (cphalcon caches, phalcon recalculates)
  • DIV 68: Crypt method name (decryptGetUnpadded vs decryptUnpadCbcEcb)
  • DIV 69: Padding classes mb_strlen vs strlen -- SYSTEMATIC (4 classes affected)
  • DIV 70: CryptInterface::decryptBase64/encryptBase64 key parameter type (string vs mixed)
  • DIV 71: Security::hash crypt/password_hash return not cast in cphalcon
  • DIV 72: JWT Token/Parser::decodeHeaders JSON decoding inconsistency in phalcon
  • DIV 73: JWT Parser exception types (granular vs InvalidArgumentException)
  • DIV 74: Security granular exception types (10+)

Filter

  • DIV 75: Filter::FILTER_STRING_LEGACY constant missing in phalcon
  • DIV 76: Filter::get exception type (FilterNotRegistered vs generic)
  • DIV 77: Validation::validate beforeValidation/afterValidation argument count -- BEHAVIORAL (3 args vs 2)
  • DIV 78: Validation::validate validator type validation (cphalcon guards, phalcon trusts)
  • DIV 79: Validation::fails null safety (cphalcon checks null, phalcon doesn't)
  • DIV 80: Validation::setLabels return type (void vs static)

Http

  • DIV 81: Http\Request::getServerArray missing in phalcon (Category A3)
  • DIV 82: Http\Request implements EventsAwareInterface in phalcon only
  • DIV 83: Http\Response class hierarchy (standalone vs extends Injectable)

Flash

  • DIV 84: AbstractFlash::prepareEscapedMessage escaper method name (escapeHtml() vs html())
  • DIV 85: AbstractFlash::getEscaperService exception and container logic
  • DIV 86: AbstractFlash::outputMessage type validation (FlashMessageNotStringOrArray vs TypeError)
  • DIV 87: Flash\Session::has() falsy vs strict null check -- BEHAVIORAL
  • DIV 88: Flash\Session::SESSION_KEY visibility (public vs private)

Forms

  • DIV 89: Form::isValid data parameter type (cphalcon accepts null, phalcon requires array)
  • DIV 90: Form::isValid entity fallback logic (cphalcon: any non-object, phalcon: null only)
  • DIV 91: Forms exception types (14 granular missing)

Logger

  • DIV 92: Logger::log message type -- Stringable support (phalcon accepts Stringable)
  • DIV 93: AbstractLogger level constants location (class vs Enum)

Messages

  • DIV 94: Messages exception types (MessagesNotIterable, MessageNotObject vs generic)

Support

  • DIV 95: Collection::getIterator ArrayIterator vs Generator -- BEHAVIORAL

Session

  • DIV 96: Session\Manager::start() order of operations -- BEHAVIORAL
  • DIV 97: Session\Manager::getAdapter() return type (missing |null in cphalcon)

Storage

  • DIV 98: Storage\Adapter\AbstractAdapter event cancellable flag (same as Cache DIV 25)
  • DIV 99: Storage\Adapter\AbstractAdapter::getSerializer() return type (missing |null in cphalcon)

Paginator

  • DIV 100: QueryBuilder::paginate() GROUP BY multiple columns -- BUG in phalcon
  • DIV 101: QueryBuilder::paginate() page zero validation (cphalcon defaults to 1, phalcon allows 0)
  • DIV 102: Paginator exception types (7 granular missing)

Time

  • DIV 103: FrozenClock::adjust() error handler safety in pre-8.3 (potential BUG in cphalcon)

Translate

  • DIV 104: NativeArray missing deprecated exists() in phalcon

Html

  • DIV 105: Escaper::__construct parameter count (0 vs 3 optional)
  • DIV 106: Escaper::escapeHtml() deprecated in cphalcon, missing in phalcon
  • DIV 107: Html exception types (5 granular missing)

Image

  • DIV 108: Image exception types (3 granular missing)

Mvc

  • DIV 109: Mvc\Model::findFirst/find static:: vs self:: -- CRITICAL (breaks inheritance)
  • DIV 110: Mvc\Model::fireEvent/fireEventCancel -- MASSIVE architectural divergence (typed event system)
  • DIV 111: Mvc\Model::appendMessagesFrom missing in cphalcon
  • DIV 112: Mvc\Model exception types (35+ granular missing)
  • DIV 113: Mvc\Model\Query method naming (_prepare* vs prepare*)
  • DIV 114: Mvc\Model\Resultset missing getResult() and refresh() in phalcon
  • DIV 115: Mvc\Model\Manager method differences (deprecated exists* vs new removeBehavior)
  • DIV 116: Mvc\Router exception types (16 granular missing)
  • DIV 117: Mvc\Model\Behavior base class name (Behavior vs AbstractBehavior)
  • DIV 118: Mvc\Url::get() parameter count (5 vs 4)
  • DIV 119: Mvc\View exception types (7 granular missing)
  • DIV 120: Mvc\View\Engine\Volt\Compiler exception types (21 granular missing)

Metadata

Metadata

Assignees

Labels

5.0The issues we want to solve in the 5.0 release6.0The issues we want to solve in the 6.0 releasenew feature requestPlanned Feature or New Feature Request
No fields configured for Feature.

Projects

Status
Implemented
Status
Implemented

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions