Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f732578

Browse files
staabmdg
authored andcommitted
Fix "Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect" (#49)
1 parent 5b455c0 commit f732578

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/Fixer/ClassAndTraitVisibilityRequiredFixer.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ protected function applyFix(SplFileInfo $file, Tokens $tokens): void
6565
* and "applyFix()" is final, there is no other way round it.
6666
*/
6767
$method = new ReflectionMethod($this->visibilityRequiredFixer, 'applyFix');
68-
$method->setAccessible(true);
68+
if (version_compare(PHP_VERSION, '8.1.0', '<')) {
69+
$method->setAccessible(true);
70+
}
6971
$method->invoke($this->visibilityRequiredFixer, $file, $tokens);
7072
}
7173

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /