From d97f95c721f3f0bf23ee6951ea51aa55e1b7609c Mon Sep 17 00:00:00 2001 From: fabiodalez-dev Date: Fri, 24 Jul 2026 09:22:16 +0200 Subject: [PATCH] fix: drop no-op ReflectionProperty::setAccessible() (PHP 8.5 forward-compat) PluginManager::pluginHasMethod() called setAccessible(true) before reading a wrapper's `instance` property. Since PHP 8.1 that call is a no-op (reflection reads non-public members without it), and under PHP 8.5 it emits a deprecation notice. With display_errors on (dev), that notice is printed before the page HTML, corrupting every rendered admin/frontend page. Removing the call is behaviour-preserving on 8.1-8.4 and clears the deprecation on 8.5; getValue() already works without it. --- app/Support/PluginManager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Support/PluginManager.php b/app/Support/PluginManager.php index 3575ac92a..7205edfdb 100644 --- a/app/Support/PluginManager.php +++ b/app/Support/PluginManager.php @@ -1720,7 +1720,8 @@ private function hasMagicMethod(object $pluginInstance, string $method): bool try { $reflection = new \ReflectionClass($pluginInstance); $instanceProperty = $reflection->getProperty('instance'); - $instanceProperty->setAccessible(true); + // No setAccessible(): it is a no-op since PHP 8.1 and emits a + // deprecation notice under PHP 8.5 that pollutes page output. $wrappedInstance = $instanceProperty->getValue($pluginInstance); if (is_object($wrappedInstance) && method_exists($wrappedInstance, $method)) {