Skip to content

Removed the deprecated ReflectionProperty::setAccessible() call#187

Merged
kbond merged 1 commit intozenstruck:1.xfrom
deluxetom:fix/php85-setaccessible-deprecation
Jan 8, 2026
Merged

Removed the deprecated ReflectionProperty::setAccessible() call#187
kbond merged 1 commit intozenstruck:1.xfrom
deluxetom:fix/php85-setaccessible-deprecation

Conversation

@deluxetom
Copy link
Copy Markdown
Contributor

@deluxetom deluxetom commented Jan 6, 2026

Summary

Remove the deprecated ReflectionProperty::setAccessible() call that causes a deprecation warning in PHP 8.5.

Background

  • ReflectionProperty::setAccessible() is deprecated since PHP 8.5
  • The method has had no effect since PHP 8.1 (reflection can access private/protected members without it)
  • CI already tests PHP 8.5 via the external workflow zenstruck/.github/.github/workflows/php-test-symfony.yml

Note

Errors in the tests aren't related to this change

Copy link
Copy Markdown
Member

@kbond kbond left a comment

Choose a reason for hiding this comment

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

Nice, thanks @deluxetom!

@kbond kbond merged commit 1831b54 into zenstruck:1.x Jan 8, 2026
3 of 16 checks passed
@deluxetom deluxetom deleted the fix/php85-setaccessible-deprecation branch January 8, 2026 14:43
kbond added a commit that referenced this pull request Feb 12, 2026
* 1.x:
  bot: fix cs [skip ci]
  changelog: update [skip ci]
  chore: support Symfony 8 (#184)
  fix: Remove deprecated `ReflectionProperty::setAccessible()` (#187)
  bot: fix cs [skip ci]
  bot: fix cs [skip ci]
  fix: resolve false positive on jsonMatches (#179)
  bot: fix cs [skip ci]
  doc: fix PHP syntax in `README.md` on use functions (#170)
  bot: sync with template [skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.5 deprecation ReflectionProperty::setAccessible()

2 participants