Skip to content

Commit 6bd0351

Browse files
authored
chore: Upgrade to Rector2 (#1167)
1 parent cf37d93 commit 6bd0351

File tree

6 files changed

+28
-33
lines changed

6 files changed

+28
-33
lines changed

src/Scoper/Composer/InstalledPackagesScoper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private static function decodeContents(string $contents): stdClass
8585
private function prefixLockPackages(array $packages): array
8686
{
8787
return array_map(
88-
fn (stdClass $package) => $this->autoloadPrefixer->prefixPackageAutoloadStatements($package),
88+
$this->autoloadPrefixer->prefixPackageAutoloadStatements(...),
8989
$packages,
9090
);
9191
}

src/Scoper/SymfonyScoper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
/**
2424
* Scopes the Symfony configuration related files.
2525
*/
26-
final class SymfonyScoper implements Scoper
26+
final readonly class SymfonyScoper implements Scoper
2727
{
28-
private readonly SymfonyXmlScoper $decoratedScoper;
28+
private SymfonyXmlScoper $decoratedScoper;
2929

3030
public function __construct(
3131
Scoper $decoratedScoper,

src/Symbol/SymbolRegistry.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
use function strtolower;
3030
use function trim;
3131

32-
final class SymbolRegistry
32+
final readonly class SymbolRegistry
3333
{
3434
/**
3535
* @var array<string, mixed>
3636
*/
37-
private readonly array $names;
37+
private array $names;
3838

3939
/**
4040
* @param string[] $names
@@ -75,8 +75,8 @@ public static function createForConstants(
7575
*/
7676
private function __construct(
7777
array $names,
78-
private readonly array $regexes,
79-
private readonly bool $constants,
78+
private array $regexes,
79+
private bool $constants,
8080
) {
8181
$this->names = array_flip($names);
8282

@@ -197,7 +197,7 @@ private static function lowerCaseConstantName(string $name): string
197197

198198
$lastPart = array_pop($parts);
199199

200-
$parts = array_map('strtolower', $parts);
200+
$parts = array_map(strtolower(...), $parts);
201201

202202
$parts[] = $lastPart;
203203

tests/Console/Command/AddPrefixCommandIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function test_scope_in_very_verbose_mode(): void
279279
*/
280280
private function createDisplayNormalizer(): callable
281281
{
282-
return fn ($display) => $this->getNormalizeDisplay($display);
282+
return $this->getNormalizeDisplay(...);
283283
}
284284

285285
private function getNormalizeDisplay(string $display): string

vendor-bin/rector/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
}
77
},
88
"require-dev": {
9-
"rector/rector": "1.0"
9+
"rector/rector": "^2.3.1"
1010
}
1111
}

vendor-bin/rector/composer.lock

Lines changed: 18 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)