File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 28
28
use Rector \CodingStyle \Rector \ClassMethod \FuncGetArgsToVariadicParamRector ;
29
29
use Rector \CodingStyle \Rector \ClassMethod \MakeInheritedMethodVisibilitySameAsParentRector ;
30
30
use Rector \CodingStyle \Rector \FuncCall \CountArrayToEmptyArrayComparisonRector ;
31
+ use Rector \CodingStyle \Rector \FuncCall \VersionCompareFuncCallToConstantRector ;
31
32
use Rector \Config \RectorConfig ;
32
33
use Rector \DeadCode \Rector \ClassMethod \RemoveUnusedConstructorParamRector ;
33
34
use Rector \DeadCode \Rector \ClassMethod \RemoveUnusedPrivateMethodRector ;
149
150
$ rectorConfig ->rule (CompleteDynamicPropertiesRector::class);
150
151
$ rectorConfig ->rule (BooleanInIfConditionRuleFixerRector::class);
151
152
$ rectorConfig ->rule (SingleInArrayToCompareRector::class);
153
+ $ rectorConfig ->rule (VersionCompareFuncCallToConstantRector::class);
152
154
153
155
$ rectorConfig
154
156
->ruleWithConfiguration (StringClassNameToClassConstantRector::class, [
Original file line number Diff line number Diff line change @@ -346,11 +346,7 @@ public function sanitizeFilename(string $filename): string
346
346
);
347
347
}
348
348
if ($ result === false ) {
349
- if (version_compare (PHP_VERSION , '8.0.0 ' , '>= ' )) {
350
- $ message = preg_last_error_msg ();
351
- } else {
352
- $ message = 'Regex error. error code: ' . preg_last_error ();
353
- }
349
+ $ message = PHP_VERSION_ID >= 80000 ? preg_last_error_msg () : 'Regex error. error code: ' . preg_last_error ();
354
350
355
351
throw new RuntimeException ($ message . '. filename: " ' . $ filename . '" ' );
356
352
}
You can’t perform that action at this time.
0 commit comments