Skip to content

Commit 0ea2300

Browse files
committed
build(deps-dev): updated rector/rector to ^2.1.4
1 parent 0e80d17 commit 0ea2300

File tree

5 files changed

+17
-27
lines changed

5 files changed

+17
-27
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require-dev": {
1919
"doctrine/coding-standard": "^12.0",
2020
"phpunit/phpunit": "^10.5.35",
21-
"rector/rector": "^1.2",
21+
"rector/rector": "^2.1.4",
2222
"squizlabs/php_codesniffer": "^3.7",
2323
"vimeo/psalm": "6.5.*"
2424
},

rector.php

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,29 @@
55
use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector;
66
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
77
use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;
8-
use Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector;
9-
use Rector\PHPUnit\Set\PHPUnitSetList;
10-
use Rector\Set\ValueObject\LevelSetList;
118

12-
return static function (RectorConfig $rectorConfig): void {
13-
$rectorConfig->paths([
9+
return RectorConfig::configure()
10+
->withPaths([
1411
__DIR__ . '/examples',
1512
__DIR__ . '/src',
1613
__DIR__ . '/tests',
1714
__DIR__ . '/tools',
18-
]);
19-
20-
// Modernize code
21-
$rectorConfig->sets([
22-
LevelSetList::UP_TO_PHP_74,
23-
PHPUnitSetList::PHPUNIT_100,
24-
]);
25-
26-
$rectorConfig->rule(ChangeSwitchToMatchRector::class);
27-
$rectorConfig->rule(StaticDataProviderClassMethodRector::class);
28-
15+
])
16+
->withPhpSets(php74: true)
17+
->withComposerBased(phpunit: true)
18+
->withRules([
19+
ChangeSwitchToMatchRector::class,
20+
])
21+
// All classes are public API by default, unless marked with @internal.
22+
->withConfiguredRule(RemoveAnnotationRector::class, ['api'])
2923
// phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified
30-
$rectorConfig->skip([
24+
->withSkip([
3125
RemoveExtraParametersRector::class,
3226
// Do not use ternaries extensively
3327
IfIssetToCoalescingRector::class,
3428
ChangeSwitchToMatchRector::class => [
3529
__DIR__ . '/tests/SpecTests/Operation.php',
3630
],
37-
]);
31+
])
3832
// phpcs:enable
39-
40-
// All classes are public API by default, unless marked with @internal.
41-
$rectorConfig->ruleWithConfiguration(RemoveAnnotationRector::class, ['api']);
42-
};
33+
->withImportNames(importNames: false, removeUnusedImports: true);

src/GridFS/Bucket.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
use MongoDB\GridFS\Exception\StreamException;
3636
use MongoDB\Model\BSONArray;
3737
use MongoDB\Model\BSONDocument;
38-
use MongoDB\Operation\Find;
3938

4039
use function array_intersect_key;
4140
use function array_key_exists;

tools/connect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
function getHosts(string $uri): array
44
{
5-
if (strpos($uri, '://') === false) {
5+
if (! str_contains($uri, '://')) {
66
return [$uri];
77
}
88

tools/detect-extension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ function grepIniFile(string $filename, string $extension): int
55
$lines = [];
66

77
foreach (new SplFileObject($filename) as $i => $line) {
8-
if (strpos($line, 'extension') === false) {
8+
if (! str_contains($line, 'extension')) {
99
continue;
1010
}
1111

12-
if (strpos($line, $extension) === false) {
12+
if (! str_contains($line, $extension)) {
1313
continue;
1414
}
1515

0 commit comments

Comments
 (0)