Skip to content

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Aug 20, 2025

As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default. (doc)

A deprecation message is triggered as of PHP 8.5: php/php-src#19273

@Copilot Copilot AI review requested due to automatic review settings August 20, 2025 13:36
@GromNaN GromNaN requested a review from a team as a code owner August 20, 2025 13:36
@GromNaN GromNaN requested review from alcaeus and paulinevos and removed request for alcaeus August 20, 2025 13:36
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@GromNaN GromNaN requested a review from jmikola August 20, 2025 13:37
@GromNaN GromNaN changed the base branch from v2.1 to v1.21 August 20, 2025 13:42
Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@GromNaN GromNaN merged commit ebdb5c1 into mongodb:v1.21 Aug 27, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants