Skip to content

Commit

Permalink
Merge pull request #9264 from samsonasik/refactor-apply-code-quality-…
Browse files Browse the repository at this point in the history
…level-24-for-rector

refactor: Apply code quality level 24 for Rector
  • Loading branch information
samsonasik authored Nov 12, 2024
2 parents 1e9483c + b64aeef commit 9b6de62
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
12 changes: 1 addition & 11 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
use Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector;
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector;
use Rector\CodeQuality\Rector\If_\CombineIfRector;
use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector;
use Rector\CodeQuality\Rector\If_\ShortenElseIfRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
use Rector\CodeQuality\Rector\Ternary\TernaryEmptyArrayArrayDimFetchToCoalesceRector;
use Rector\CodingStyle\Rector\ClassMethod\FuncGetArgsToVariadicParamRector;
use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector;
Expand Down Expand Up @@ -188,11 +183,9 @@
CountArrayToEmptyArrayComparisonRector::class,
ChangeNestedForeachIfsToEarlyContinueRector::class,
ChangeIfElseValueAssignToEarlyReturnRector::class,
CombineIfRector::class,
InlineIfToExplicitIfRector::class,
PreparedValueToEarlyReturnRector::class,
ShortenElseIfRector::class,
SimplifyIfElseToTernaryRector::class,
UnusedForeachValueToArrayKeysRector::class,
ChangeArrayPushToArrayAssignRector::class,
RemoveErrorSuppressInTryCatchStmtsRector::class,
Expand All @@ -205,19 +198,16 @@
PrivatizeFinalClassPropertyRector::class,
CompleteDynamicPropertiesRector::class,
BooleanInIfConditionRuleFixerRector::class,
SingleInArrayToCompareRector::class,
VersionCompareFuncCallToConstantRector::class,
ExplicitBoolCompareRector::class,
AddClosureVoidReturnTypeWhereNoReturnRector::class,
AddFunctionVoidReturnTypeWhereNoReturnRector::class,
AddMethodCallBasedStrictParamTypeRector::class,
TypedPropertyFromAssignsRector::class,
ClosureReturnTypeRector::class,
SimplifyBoolIdenticalTrueRector::class,
FlipTypeControlToUseExclusiveTypeRector::class,
])
->withConfiguredRule(StringClassNameToClassConstantRector::class, [
// keep '\\' prefix string on string '\Foo\Bar'
StringClassNameToClassConstantRector::SHOULD_KEEP_PRE_SLASH => true,
])
->withCodeQualityLevel(15);
->withCodeQualityLevel(24);
2 changes: 1 addition & 1 deletion tests/system/Database/Live/OCI8/GetFieldDataTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testGetFieldDataDefault(): void
$fields = $this->db->getFieldData($this->table);

$idDefault = $this->getFieldMetaData('id', $this->table)->default;
$this->assertMatchesRegularExpression('/"ORACLE"."ISEQ\$\$_[0-9]+".nextval/', $idDefault);
$this->assertMatchesRegularExpression('/"ORACLE"."ISEQ\$\$_\d+".nextval/', $idDefault);

$expected = [
(object) [
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Database/RawSqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ public function testGetBindingKey(): void

$key = $rawSql->getBindingKey();

$this->assertMatchesRegularExpression('/\ARawSql[0-9]+\z/', $key);
$this->assertMatchesRegularExpression('/\ARawSql\d+\z/', $key);
}
}

0 comments on commit 9b6de62

Please sign in to comment.