Skip to content

Commit 7c8216f

Browse files
committed
Refactor: enable Rector Code Quality level, apply level 9 for SimplifyConditionsRector
1 parent c8b9ea4 commit 7c8216f

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

rector.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
*/
1313

1414
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
15-
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
1615
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
1716
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
1817
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
1918
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
2019
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
21-
use Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector;
2220
use Rector\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector;
2321
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
2422
use Rector\CodeQuality\Rector\If_\CombineIfRector;
@@ -190,7 +188,6 @@
190188
CountArrayToEmptyArrayComparisonRector::class,
191189
ChangeNestedForeachIfsToEarlyContinueRector::class,
192190
ChangeIfElseValueAssignToEarlyReturnRector::class,
193-
SimplifyStrposLowerRector::class,
194191
CombineIfRector::class,
195192
SimplifyIfReturnBoolRector::class,
196193
InlineIfToExplicitIfRector::class,
@@ -203,7 +200,6 @@
203200
RemoveErrorSuppressInTryCatchStmtsRector::class,
204201
FuncGetArgsToVariadicParamRector::class,
205202
MakeInheritedMethodVisibilitySameAsParentRector::class,
206-
SimplifyEmptyArrayCheckRector::class,
207203
SimplifyEmptyCheckOnEmptyArrayRector::class,
208204
TernaryEmptyArrayArrayDimFetchToCoalesceRector::class,
209205
EmptyOnNullableObjectToInstanceOfRector::class,
@@ -223,4 +219,5 @@
223219
->withConfiguredRule(StringClassNameToClassConstantRector::class, [
224220
// keep '\\' prefix string on string '\Foo\Bar'
225221
StringClassNameToClassConstantRector::SHOULD_KEEP_PRE_SLASH => true,
226-
]);
222+
])
223+
->withCodeQualityLevel(9);

tests/system/Database/Live/UpdateTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ public function testUpdateBatchConstraintsRawSqlAndAlias(): void
466466

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

@@ -557,7 +557,7 @@ public function testUpdateBatchUpdateFieldsAndAlias(): void
557557

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

@@ -599,7 +599,7 @@ public function testUpdateBatchWithoutOnConstraint(): void
599599

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

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

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

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

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

0 commit comments

Comments
 (0)