Conversation
…r.zep Co-authored-by: niden <1073784+niden@users.noreply.github.com> Agent-Logs-Url: https://github.com/phalcon/cphalcon/sessions/17a04349-0cde-4941-9bb5-c53716592f69
Copilot
AI
changed the title
[WIP] Fix deprecated ReflectionParameter::getClass method
Fix fatal error when using PHP 8.1+ union/intersection types in ACL callbacks and Model Binder
Mar 23, 2026
niden
requested changes
Mar 23, 2026
Member
niden
left a comment
There was a problem hiding this comment.
Please move the entry in the CHANGELOG-5.0 to the unreleased version
Co-authored-by: niden <1073784+niden@users.noreply.github.com> Agent-Logs-Url: https://github.com/phalcon/cphalcon/sessions/7a789ab6-f002-4bb5-9939-93092de0a1ec
Contributor
Author
Done — moved the entry to the |
niden
approved these changes
Mar 23, 2026
niden
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In raising this pull request, I confirm the following:
ReflectionParameter::getClass()was deprecated in PHP 8.0 and bothAcl\Adapter\MemoryandMvc\Model\Binderwere already updated to usegetType(). However,getType()in PHP 8.0+ can returnReflectionUnionTypeorReflectionIntersectionType, neither of which has agetName()method — causing a fatal error when union or intersection types appear in ACL callbacks or controller action parameters.Changes
Acl/Adapter/Memory.zep: Adduse ReflectionNamedTypeand guardgetName()call withinstanceof ReflectionNamedTypecheck. Union/intersection type parameters fall through to the user-suppliedparametersarray as before.Mvc/Model/Binder.zep: Adduse ReflectionNamedTypeand skip model binding (continue) for non-named types — correct behavior since we cannot determine which model class to bind for a union type.tests/unit/Acl/Adapter/Memory/IsAllowedCest.php: Add test verifying union type parameters in ACL callbacks work without fatal errors.CHANGELOG-5.0.md: Entry added to the unreleased5.11.0version section.Thanks
Original prompt
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.