Skip to content

Fix PHP 8.5 setAccessible() deprecations#50

Merged
hrach merged 1 commit intonextras:masterfrom
trejjam:fix/filemailer-setaccessible-php-8.5
Apr 21, 2026
Merged

Fix PHP 8.5 setAccessible() deprecations#50
hrach merged 1 commit intonextras:masterfrom
trejjam:fix/filemailer-setaccessible-php-8.5

Conversation

@trejjam
Copy link
Copy Markdown
Contributor

@trejjam trejjam commented Apr 21, 2026

PHP 8.5 deprecates ReflectionMethod::setAccessible() / ReflectionProperty::setAccessible() since they've been no-ops since 8.1. This wraps the two remaining unguarded calls in if (PHP_VERSION_ID < 80100) to silence the warning while keeping PHP 7.1–8.0 support (per composer.json).

Changes:

  • src/FileMailer.php — guarded
  • tests/MailPanelTest.phpt — guarded
  • src/MailPanel.php:206 was already guarded correctly, left alone

#45 did the same thing for one call in MailPanel.php but missed these two.

Wraps two unguarded ReflectionMethod::setAccessible(true) calls in
PHP_VERSION_ID < 80100 checks:

- src/FileMailer.php (Message::build())
- tests/MailPanelTest.phpt (MailPanel::getLatte())

The remaining call in src/MailPanel.php was already guarded correctly
by nextras#45 and is left untouched. Preserves PHP 7.1-8.0 support per
composer.json.
@trejjam trejjam force-pushed the fix/filemailer-setaccessible-php-8.5 branch from 6e39aca to 1ff6b3f Compare April 21, 2026 20:21
@hrach hrach merged commit f64fd86 into nextras:master Apr 21, 2026
1 of 12 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