File tree Expand file tree Collapse file tree 4 files changed +4
-23
lines changed
Expand file tree Collapse file tree 4 files changed +4
-23
lines changed Original file line number Diff line number Diff line change 99 ],
1010 "require" : {
1111 "php" : " ^7.4|^8.0" ,
12- "phpstan/phpstan" : " ^2.1.38 "
12+ "phpstan/phpstan" : " ^2.1.40 "
1313 },
1414 "autoload" : {
1515 "files" : [
Original file line number Diff line number Diff line change 2323 "nikic/php-parser" : " ^5.7" ,
2424 "ondram/ci-detector" : " ^4.2" ,
2525 "phpstan/phpdoc-parser" : " ^2.3" ,
26- "phpstan/phpstan" : " ^2.1.38 " ,
26+ "phpstan/phpstan" : " ^2.1.40 " ,
2727 "react/event-loop" : " ^1.6" ,
2828 "react/promise" : " ^3.3" ,
2929 "react/socket" : " ^1.17" ,
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public function refactor(Node $node): ?ClassConstFetch
109109 }
110110
111111 $ constant = $ classReflection ->getConstant ($ constantName );
112- if (! $ constant ->isFinal ()) {
112+ if (! $ constant ->isFinalByKeyword ()) {
113113 return null ;
114114 }
115115 }
Original file line number Diff line number Diff line change 1919use Rector \Php \PhpVersionProvider ;
2020use Rector \PHPStan \ScopeFetcher ;
2121use Rector \Rector \AbstractRector ;
22- use Rector \ValueObject \PhpVersionFeature ;
23- use ReflectionClassConstant ;
2422use Symplify \RuleDocGenerator \ValueObject \CodeSample \CodeSample ;
2523use Symplify \RuleDocGenerator \ValueObject \RuleDefinition ;
2624
@@ -171,25 +169,8 @@ private function shouldSkip(
171169 }
172170
173171 if (! $ isFinal ) {
174- // init
175- $ memberIsFinal = false ;
176172 if ($ reflection instanceof ClassConstantReflection) {
177- // Get the native ReflectionClassConstant
178- $ declaringClass = $ reflection ->getDeclaringClass ();
179- $ nativeReflectionClass = $ declaringClass ->getNativeReflection ();
180- $ constantName = $ reflection ->getName ();
181-
182- if (
183- // by feature config
184- $ this ->phpVersionProvider ->isAtLeastPhpVersion (PhpVersionFeature::FINAL_CLASS_CONSTANTS ) &&
185- // ensure native ->isFinal() exists
186- // @see https://3v4l.org/korKr#v8.0.11
187- PHP_VERSION_ID >= PhpVersionFeature::FINAL_CLASS_CONSTANTS
188- ) {
189- // PHP 8.1+
190- $ nativeReflection = $ nativeReflectionClass ->getReflectionConstant ($ constantName );
191- $ memberIsFinal = $ nativeReflection instanceof ReflectionClassConstant && $ nativeReflection ->isFinal ();
192- }
173+ $ memberIsFinal = $ reflection ->isFinalByKeyword ();
193174 } else {
194175 $ memberIsFinal = $ reflection ->isFinalByKeyword ()
195176 ->yes ();
You can’t perform that action at this time.
0 commit comments