Skip to content

Commit d9ec94b

Browse files
authored
chore: Bump Rector to 2.5.3 and re-run it (#10375)
* chore: Bump Rector to 2.5.3 and re-run it * chore: apply cs fix
1 parent 5e7c6ef commit d9ec94b

7 files changed

Lines changed: 18 additions & 18 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"phpunit/phpcov": "^9.0.2 || ^10.0",
3030
"phpunit/phpunit": "^10.5.16 || ^11.2",
3131
"predis/predis": "^3.0",
32-
"rector/rector": "2.5.2",
32+
"rector/rector": "2.5.3",
3333
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
3434
},
3535
"replace": {

rector.php

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

1414
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
15+
use Rector\CodeQuality\Rector\BooleanNot\NegatedAndsToPositiveOrsRector;
1516
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
1617
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
1718
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
@@ -22,6 +23,7 @@
2223
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
2324
use Rector\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConstantRector;
2425
use Rector\Config\RectorConfig;
26+
use Rector\DeadCode\Rector\ClassMethod\RemoveDuplicatedReturnSelfDocblockRector;
2527
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector;
2628
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodRector;
2729
use Rector\DeadCode\Rector\MethodCall\RemoveNullArgOnNullDefaultParamRector;
@@ -36,7 +38,6 @@
3638
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
3739
use Rector\PHPUnit\CodeQuality\Rector\FuncCall\AssertFuncCallToPHPUnitAssertRector;
3840
use Rector\PHPUnit\CodeQuality\Rector\StmtsAwareInterface\DeclareStrictTypesTestsRector;
39-
use Rector\PostRector\Rector\UnusedImportRemovingPostRector;
4041
use Rector\Privatization\Rector\Class_\FinalizeTestCaseClassRector;
4142
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
4243
use Rector\Renaming\Rector\ConstFetch\RenameConstantRector;
@@ -175,10 +176,9 @@
175176
__DIR__ . '/tests/system/Models',
176177
],
177178

178-
UnusedImportRemovingPostRector::class => [
179-
// buggy on auto import removed
180-
__DIR__ . '/system/HTTP/Response.php',
181-
],
179+
// to be applied in separate PRs to ease review
180+
NegatedAndsToPositiveOrsRector::class,
181+
RemoveDuplicatedReturnSelfDocblockRector::class,
182182
])
183183
// auto import fully qualified class names
184184
->withImportNames()

system/Database/BaseBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,7 +2686,7 @@ protected function _updateBatch(string $table, array $keys, array $values): stri
26862686
$sql .= 'WHERE ' . implode(
26872687
' AND ',
26882688
array_map(
2689-
static fn ($key, $value) => (
2689+
static fn ($key, $value): RawSql|string => (
26902690
($value instanceof RawSql && is_string($key))
26912691
?
26922692
$table . '.' . $key . ' = ' . $value
@@ -2936,7 +2936,7 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri
29362936
$sql .= 'ON ' . implode(
29372937
' AND ',
29382938
array_map(
2939-
static fn ($key, $value) => (
2939+
static fn ($key, $value): RawSql|string => (
29402940
$value instanceof RawSql ?
29412941
$value :
29422942
(

system/Database/MySQLi/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected function _updateBatch(string $table, array $keys, array $values): stri
9292
$sql .= 'ON ' . implode(
9393
' AND ',
9494
array_map(
95-
static fn ($key, $value) => (
95+
static fn ($key, $value): RawSql|string => (
9696
($value instanceof RawSql && is_string($key))
9797
?
9898
$table . '.' . $key . ' = ' . $value

system/Database/OCI8/Builder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ protected function _updateBatch(string $table, array $keys, array $values): stri
248248
$sql .= 'ON (' . implode(
249249
' AND ',
250250
array_map(
251-
static fn ($key, $value) => (
251+
static fn ($key, $value): RawSql|string => (
252252
($value instanceof RawSql && is_string($key))
253253
?
254254
$table . '.' . $key . ' = ' . $value
@@ -353,7 +353,7 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
353353
$sql .= implode(
354354
' AND ',
355355
array_map(
356-
static fn ($key, $value) => (
356+
static fn ($key, $value): RawSql|string => (
357357
($value instanceof RawSql && is_string($key))
358358
?
359359
$table . '.' . $key . ' = ' . $value
@@ -442,7 +442,7 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri
442442
$sql .= 'WHERE ' . implode(
443443
' AND ',
444444
array_map(
445-
static fn ($key, $value) => (
445+
static fn ($key, $value): RawSql|string => (
446446
$value instanceof RawSql ?
447447
$value :
448448
(

system/Database/SQLSRV/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
752752
$sql .= implode(
753753
' AND ',
754754
array_map(
755-
static fn ($key, $value) => (
755+
static fn ($key, $value): RawSql|string => (
756756
($value instanceof RawSql && is_string($key))
757757
?
758758
$fullTableName . '.' . $key . ' = ' . $value

tests/system/Test/FeatureTestTraitTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public function testCallGetWithParams(): void
412412
[
413413
'GET',
414414
'home',
415-
static fn () => json_encode(service('request')->getGet()),
415+
static fn (): false|string => json_encode(service('request')->getGet()),
416416
],
417417
]);
418418
$data = [
@@ -439,7 +439,7 @@ public function testCallGetWithParamsAndREQUEST(): void
439439
[
440440
'GET',
441441
'home',
442-
static fn () => json_encode(service('request')->fetchGlobal('request')),
442+
static fn (): false|string => json_encode(service('request')->fetchGlobal('request')),
443443
],
444444
]);
445445
$data = [
@@ -466,7 +466,7 @@ public function testCallPostWithParams(): void
466466
[
467467
'POST',
468468
'home',
469-
static fn () => json_encode(service('request')->getPost()),
469+
static fn (): false|string => json_encode(service('request')->getPost()),
470470
],
471471
]);
472472
$data = [
@@ -493,7 +493,7 @@ public function testCallPostWithParamsAndREQUEST(): void
493493
[
494494
'POST',
495495
'home',
496-
static fn () => json_encode(service('request')->fetchGlobal('request')),
496+
static fn (): false|string => json_encode(service('request')->fetchGlobal('request')),
497497
],
498498
]);
499499
$data = [
@@ -544,7 +544,7 @@ public function testCallPutWithJsonRequestAndREQUEST(): void
544544
[
545545
'PUT',
546546
'home',
547-
static fn () => json_encode(service('request')->fetchGlobal('request')),
547+
static fn (): false|string => json_encode(service('request')->fetchGlobal('request')),
548548
],
549549
]);
550550
$data = [

0 commit comments

Comments
 (0)