Remove calls to ReflectionProperty::setAccessible(true)#1761
Merged
GromNaN merged 1 commit intomongodb:v1.21from Aug 27, 2025
Merged
Remove calls to ReflectionProperty::setAccessible(true)#1761GromNaN merged 1 commit intomongodb:v1.21from
ReflectionProperty::setAccessible(true)#1761GromNaN merged 1 commit intomongodb:v1.21from
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes deprecated calls to ReflectionProperty::setAccessible(true) which became unnecessary in PHP 8.1.0 and will trigger deprecation warnings in PHP 8.5.
- Removes
setAccessible(true)calls from reflection property access in test files - Updates code to align with modern PHP best practices for reflection
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/Database/DatabaseFunctionalTest.php | Removes two setAccessible(true) calls from reflection property access in test methods |
| tests/Collection/CollectionFunctionalTest.php | Removes two setAccessible(true) calls from reflection property access in test methods |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ffb2bd8 to
05b42ea
Compare
jmikola
approved these changes
Aug 27, 2025
Contributor
jmikola
left a comment
There was a problem hiding this comment.
Noted that v1.21 requires 8.1+, so there's no concern with supporting older PHP versions. Glad to see this method removed, as it never quite made sense to me.
This was referenced Aug 27, 2025
Closed
Merged
Merged
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.
A deprecation message is triggered as of PHP 8.5: php/php-src#19273