Skip to content

PHP 8.5: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect #89

@tbradsha

Description

@tbradsha

As of PHP 8.1, Reflection*::setAccessible() has been a no-op. In PHP 8.5, it triggers deprecation notices:

php/php-src@922c225

There are a few instances in this package:

$property = new ReflectionProperty(Facade::class, 'sealed');
$property->setAccessible(true);
$property->setValue($facade, false);
$method = new ReflectionMethod($facade, 'deferredDispatcher');
$method->setAccessible(true);
$dispatcher = $method->invoke($facade);
$propDispatcher = new ReflectionProperty($dispatcher, 'dispatcher');
$propDispatcher->setAccessible(true);
$directDispatcher = $propDispatcher->getValue($dispatcher);
$propSubscribers = new ReflectionProperty($directDispatcher, 'subscribers');
$propSubscribers->setAccessible(true);

$reflectionTemplates->setAccessible(true);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions