File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
rules/CodeQuality/Rector/Class_ Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,13 @@ private function shouldSkip(
179179 $ nativeReflectionClass = $ declaringClass ->getNativeReflection ();
180180 $ constantName = $ reflection ->getName ();
181181
182- if ($ this ->phpVersionProvider ->isAtLeastPhpVersion (PhpVersionFeature::FINAL_CLASS_CONSTANTS )) {
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+ ) {
183189 // PHP 8.1+
184190 $ nativeReflection = $ nativeReflectionClass ->getReflectionConstant ($ constantName );
185191 $ memberIsFinal = $ nativeReflection instanceof ReflectionClassConstant && $ nativeReflection ->isFinal ();
You can’t perform that action at this time.
0 commit comments