From b64aeef0eafb7707d510e2976d67b221bde31453 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 11 Nov 2024 09:00:41 +0700 Subject: [PATCH] refactor: Apply code quality level 24 for Rector --- rector.php | 12 +----------- .../Database/Live/OCI8/GetFieldDataTestCase.php | 2 +- tests/system/Database/RawSqlTest.php | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/rector.php b/rector.php index be9e45f1e169..64abc9a73541 100644 --- a/rector.php +++ b/rector.php @@ -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; @@ -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, @@ -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); diff --git a/tests/system/Database/Live/OCI8/GetFieldDataTestCase.php b/tests/system/Database/Live/OCI8/GetFieldDataTestCase.php index a45c893dc3f9..2ff1f103fb33 100644 --- a/tests/system/Database/Live/OCI8/GetFieldDataTestCase.php +++ b/tests/system/Database/Live/OCI8/GetFieldDataTestCase.php @@ -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) [ diff --git a/tests/system/Database/RawSqlTest.php b/tests/system/Database/RawSqlTest.php index 340e85c0ffba..fe26130cd0ee 100644 --- a/tests/system/Database/RawSqlTest.php +++ b/tests/system/Database/RawSqlTest.php @@ -49,6 +49,6 @@ public function testGetBindingKey(): void $key = $rawSql->getBindingKey(); - $this->assertMatchesRegularExpression('/\ARawSql[0-9]+\z/', $key); + $this->assertMatchesRegularExpression('/\ARawSql\d+\z/', $key); } }