Skip to content

Commit 909f673

Browse files
committed
Avoid setAccessible deprecation warnings
1 parent c2a800d commit 909f673

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/command.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ private static function update_commands_data( $command, &$commands_data, $full )
280280
if ( $reflection->hasProperty( 'when_invoked' ) ) {
281281
$filename = '';
282282
$when_invoked = $reflection->getProperty( 'when_invoked' );
283-
$when_invoked->setAccessible( true );
283+
if ( PHP_VERSION_ID < 80100 ) {
284+
$when_invoked->setAccessible( true );
285+
}
284286
$closure = $when_invoked->getValue( $command );
285287
$closure_reflection = new \ReflectionFunction( $closure );
286288
// PHP stores use clause arguments of closures as static variables internally - see https://bugs.php.net/bug.php?id=71250

0 commit comments

Comments
 (0)