Implement isPublicSet(), fix isVirtual(), add isVirtual to parity tests (P3 + P5)#170
Merged
lisachenko merged 1 commit intomasterfrom Apr 27, 2026
Merged
Conversation
- P3: Add isPublicSet() method to ReflectionProperty that returns true when the set visibility is explicitly public(set) and the main visibility is not already public. Includes standalone test since native PHP 8.4 does not have this method. - P5: Add 'isVirtual' to the parity test getters for PHP 8.4. - Fix isVirtual() to correctly detect backing store usage: - Short set hooks (set => expr) always use the backing store - Block-form hooks that reference $this->propertyName use the backing store Refs #165, #167 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Implements two sub-tasks from #162 (PHP 8.3/8.4 parity meta-issue):
P3 (#165):
isPublicSet()methodisPublicSet()toReflectionPropertythat returnstruewhen the set visibility is explicitlypublic(set)and the main visibility is not alreadypublicisPublicSet()on the underlyingProperty/Paramnode\ReflectionPropertydoes not haveisPublicSet(), so parity testing is done via standalone test with expected valuesP5 (#167):
isVirtual()in parity test getters'isVirtual'to the PHP 8.4 getters ingetGettersToCheck()so the parity test compares output with native reflectionBug fix:
isVirtual()implementationisVirtualto parity tests exposed an incorrect implementationbyRefon hooks — now correctly detects backing store usage:sethooks (set => expr) always use backing store → NOT virtual$this->propertyNameuse backing store → NOT virtualNodeFinderto walk AST for$this->propertyNamereferences in block-form hooksReview & Testing Checklist for Human
isPublicSet()semantics match your expectations — since native PHP lacks this method, the behavior is defined by us (returnsfalsefor all valid PHP 8.4 code sincepublic(set)can't widen beyond main visibility)isVirtual()fix handles edge cases: short get-only hooks (virtual), short set hooks (not virtual), block set hooks with/without$this->propreferencevendor/bin/phpunit— all 11807 tests should pass with 0 failuresNotes
Link to Devin session: https://app.devin.ai/sessions/9af7c65d163e48af819f6c20c039d99b
Requested by: @lisachenko