Skip to content

Commit

Permalink
Refactor: enable Rector Code Quality level, apply level 9 for Simplif…
Browse files Browse the repository at this point in the history
…yConditionsRector
  • Loading branch information
samsonasik committed Oct 15, 2024
1 parent c8b9ea4 commit 7c8216f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 2 additions & 5 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
*/

use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
use Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector;
use Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector;
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\If_\CombineIfRector;
Expand Down Expand Up @@ -190,7 +188,6 @@
CountArrayToEmptyArrayComparisonRector::class,
ChangeNestedForeachIfsToEarlyContinueRector::class,
ChangeIfElseValueAssignToEarlyReturnRector::class,
SimplifyStrposLowerRector::class,
CombineIfRector::class,
SimplifyIfReturnBoolRector::class,
InlineIfToExplicitIfRector::class,
Expand All @@ -203,7 +200,6 @@
RemoveErrorSuppressInTryCatchStmtsRector::class,
FuncGetArgsToVariadicParamRector::class,
MakeInheritedMethodVisibilitySameAsParentRector::class,
SimplifyEmptyArrayCheckRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
TernaryEmptyArrayArrayDimFetchToCoalesceRector::class,
EmptyOnNullableObjectToInstanceOfRector::class,
Expand All @@ -223,4 +219,5 @@
->withConfiguredRule(StringClassNameToClassConstantRector::class, [
// keep '\\' prefix string on string '\Foo\Bar'
StringClassNameToClassConstantRector::SHOULD_KEEP_PRE_SLASH => true,
]);
])
->withCodeQualityLevel(9);
10 changes: 5 additions & 5 deletions tests/system/Database/Live/UpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public function testUpdateBatchConstraintsRawSqlAndAlias(): void

public function testUpdateBatchUpdateFieldsAndAlias(): void
{
if ($this->db->DBDriver === 'SQLite3' && ! (version_compare($this->db->getVersion(), '3.33.0') >= 0)) {
if ($this->db->DBDriver === 'SQLite3' && version_compare($this->db->getVersion(), '3.33.0') < 0) {
$this->markTestSkipped('Only SQLite 3.33 and newer can complete this test.');
}

Expand Down Expand Up @@ -557,7 +557,7 @@ public function testUpdateBatchUpdateFieldsAndAlias(): void

public function testUpdateBatchWithoutOnConstraint(): void
{
if ($this->db->DBDriver === 'SQLite3' && ! (version_compare($this->db->getVersion(), '3.33.0') >= 0)) {
if ($this->db->DBDriver === 'SQLite3' && version_compare($this->db->getVersion(), '3.33.0') < 0) {
$this->markTestSkipped('Only SQLite 3.33 and newer can complete this test.');
}

Expand Down Expand Up @@ -599,7 +599,7 @@ public function testUpdateBatchWithoutOnConstraint(): void

public function testRawSqlConstraint(): void
{
if ($this->db->DBDriver === 'SQLite3' && ! (version_compare($this->db->getVersion(), '3.33.0') >= 0)) {
if ($this->db->DBDriver === 'SQLite3' && version_compare($this->db->getVersion(), '3.33.0') < 0) {
$this->markTestSkipped('Only SQLite 3.33 and newer can complete this test.');
}

Expand All @@ -623,7 +623,7 @@ public function testRawSqlConstraint(): void

public function testRawSqlConstraintWithKey(): void
{
if ($this->db->DBDriver === 'SQLite3' && ! (version_compare($this->db->getVersion(), '3.33.0') >= 0)) {
if ($this->db->DBDriver === 'SQLite3' && version_compare($this->db->getVersion(), '3.33.0') < 0) {
$this->markTestSkipped('Only SQLite 3.33 and newer can complete this test.');
}

Expand Down Expand Up @@ -710,7 +710,7 @@ public function testUpdateBatchWithQuery(): void
];
$this->db->table('user2')->insertBatch($data);

if ($this->db->DBDriver === 'SQLite3' && ! (version_compare($this->db->getVersion(), '3.33.0') >= 0)) {
if ($this->db->DBDriver === 'SQLite3' && version_compare($this->db->getVersion(), '3.33.0') < 0) {
$this->markTestSkipped('Only SQLite 3.33 and newer can complete this test.');
}

Expand Down

0 comments on commit 7c8216f

Please sign in to comment.