Problem/Motivation

The Reflection*::setAccessible() is deprecated and throws deprecation warning since PHP 8.5 beta1.
General usage was removed in #3224941: Remove usage of setAccessible() when core requires PHP 8.1 and #3540525: Remove remaining usage of setAccessible()

Steps to reproduce

drupal$ git grep setAccessible
core/tests/Drupal/Tests/Core/Theme/Icon/IconPackManagerTest.php:91:    $method->setAccessible(TRUE);

Proposed resolution

- remove remaining usage

Remaining tasks

MR, review, commit

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3551109

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andypost created an issue. See original summary.

andypost’s picture

mstrelan’s picture

Status: Needs review » Reviewed & tested by the community

Test still passes after this is removed.

Can confirm this is the only remaining usage.

Sorry if this has been discussed already, but should we be running phpstan analysis for 8.5? I see this in the output:

PHP runtime version: 8.4.13
PHP version for analysis: 8.3 (from config.platform.php in composer.json)

Presumably IconPackManagerTest would have failed phpstan if it was running on 8.5. But then we might not catch issues for 8.3, so it's a double edged sword unless we run it for all supported versions.

catch’s picture

Status: Reviewed & tested by the community » Fixed

I think we've tended to run against the minimum supported version (e.g. 8.3). We can definitely run against 8.5 once Drupal 12 is open (in a couple of months-ish). Running phpstan against multiple versions is probably worth an issue, I guess it will be OK if we don't need to worry about different baselines.

Committed/pushed to 11.x, thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

  • catch committed 906f40bd on 11.x
    Issue #3551109 by andypost: Remove last usage of setAccessible()
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.