Make WordPress Core

Changeset 60903


Ignore:
Timestamp:
10/06/2025 08:26:06 AM (13 months ago)
Author:
swissspidy
Message:

Privacy: Wrap Reflection*::setAccessible() call in conditional check.

These methods are no-ops since PHP 8.1 and deprecated since PHP 8.5.

Reference: ​PHP RFC: Deprecations for PHP 8.5: Deprecate `Reflection*::setAccessible()`.

See #63956, #44267.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php

    r60891 r60903  
    223223                $reflection = new ReflectionClass( $table );
    224224                $method     = $reflection->getMethod( 'get_timestamp_as_date' );
    225                 $method->setAccessible( true );
     225                if ( PHP_VERSION_ID < 80100 ) {
     226                        $method->setAccessible( true );
     227                }
    226228
    227229                $date_format = __( 'Y/m/d' );
Note: See TracChangeset for help on using the changeset viewer.