Skip to content

Commit 041a59d

Browse files
committed
apply rector and bump to PHP 8.2
1 parent 43d36f7 commit 041a59d

File tree

44 files changed

+127
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+127
-147
lines changed

rector.php

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,21 @@
44

55
use Rector\Config\RectorConfig;
66
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
7-
use Rector\PHPUnit\Set\PHPUnitSetList;
8-
use Rector\Set\ValueObject\LevelSetList;
9-
use Rector\Set\ValueObject\SetList;
107

11-
return static function (RectorConfig $rectorConfig): void {
12-
$rectorConfig->sets([
13-
PHPUnitSetList::PHPUNIT_100,
14-
SetList::CODE_QUALITY,
15-
SetList::DEAD_CODE,
16-
LevelSetList::UP_TO_PHP_81,
17-
SetList::CODING_STYLE,
18-
SetList::TYPE_DECLARATION,
19-
SetList::NAMING,
20-
SetList::PRIVATIZATION,
21-
SetList::EARLY_RETURN,
22-
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
23-
]);
24-
25-
$rectorConfig->paths([
8+
return RectorConfig::configure()
9+
->withPreparedSets(deadCode: true, codeQuality: true, codingStyle: true, typeDeclarations: true, naming: true, privatization: true)
10+
->withRootFiles()
11+
->withPhpSets()
12+
->withPaths([
2613
__DIR__ . '/src',
2714
__DIR__ . '/tests',
28-
]);
29-
30-
$rectorConfig->importNames();
31-
32-
$rectorConfig->skip([
15+
])
16+
->withSkip([
3317
'*/Source/*',
3418
'*/Fixture/*',
3519
// keep prefix
3620
StringClassNameToClassConstantRector::class => [
3721
// keep the container class string, to avoid prefixing
3822
__DIR__ . '/src/NodeFactory/ContainerConfiguratorReturnClosureFactory.php',
3923
],
40-
41-
// preference
42-
\Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class,
4324
]);
44-
};

src/CaseConverter/AliasCaseConverter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Symplify\PhpConfigPrinter\ValueObject\VariableName;
2222
use Symplify\PhpConfigPrinter\ValueObject\YamlKey;
2323

24-
final class AliasCaseConverter implements CaseConverterInterface
24+
final readonly class AliasCaseConverter implements CaseConverterInterface
2525
{
2626
/**
2727
* @see https://regex101.com/r/BwXkfO/2/
@@ -36,9 +36,9 @@ final class AliasCaseConverter implements CaseConverterInterface
3636
private const NAMED_ALIAS_REGEX = '#\w+\s+\$\w+#';
3737

3838
public function __construct(
39-
private readonly CommonNodeFactory $commonNodeFactory,
40-
private readonly ArgsNodeFactory $argsNodeFactory,
41-
private readonly ServiceOptionNodeFactory $serviceOptionNodeFactory,
39+
private CommonNodeFactory $commonNodeFactory,
40+
private ArgsNodeFactory $argsNodeFactory,
41+
private ServiceOptionNodeFactory $serviceOptionNodeFactory,
4242
) {
4343
}
4444

src/CaseConverter/ClassServiceCaseConverter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
use Symplify\PhpConfigPrinter\ValueObject\VariableName;
1616
use Symplify\PhpConfigPrinter\ValueObject\YamlKey;
1717

18-
final class ClassServiceCaseConverter implements CaseConverterInterface
18+
final readonly class ClassServiceCaseConverter implements CaseConverterInterface
1919
{
2020
public function __construct(
21-
private readonly ArgsNodeFactory $argsNodeFactory,
22-
private readonly ServiceOptionNodeFactory $serviceOptionNodeFactory
21+
private ArgsNodeFactory $argsNodeFactory,
22+
private ServiceOptionNodeFactory $serviceOptionNodeFactory
2323
) {
2424
}
2525

src/CaseConverter/ConfiguredServiceCaseConverter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
use Symplify\PhpConfigPrinter\ValueObject\VariableName;
1616
use Symplify\PhpConfigPrinter\ValueObject\YamlKey;
1717

18-
final class ConfiguredServiceCaseConverter implements CaseConverterInterface
18+
final readonly class ConfiguredServiceCaseConverter implements CaseConverterInterface
1919
{
2020
public function __construct(
21-
private readonly ArgsNodeFactory $argsNodeFactory,
22-
private readonly ServiceOptionNodeFactory $serviceOptionNodeFactory
21+
private ArgsNodeFactory $argsNodeFactory,
22+
private ServiceOptionNodeFactory $serviceOptionNodeFactory
2323
) {
2424
}
2525

src/CaseConverter/ImportCaseConverter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
* imports: <---
2929
*/
30-
final class ImportCaseConverter implements CaseConverterInterface
30+
final readonly class ImportCaseConverter implements CaseConverterInterface
3131
{
3232
/**
3333
* @see https://regex101.com/r/hOTdIE/1
@@ -36,8 +36,8 @@ final class ImportCaseConverter implements CaseConverterInterface
3636
private const INPUT_SUFFIX_REGEX = '#\.(yml|yaml|xml)$#';
3737

3838
public function __construct(
39-
private readonly YamlArgumentSorter $yamlArgumentSorter,
40-
private readonly CommonNodeFactory $commonNodeFactory
39+
private YamlArgumentSorter $yamlArgumentSorter,
40+
private CommonNodeFactory $commonNodeFactory
4141
) {
4242
}
4343

src/CaseConverter/NameOnlyServiceCaseConverter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
use Symplify\PhpConfigPrinter\ValueObject\VariableName;
1515
use Symplify\PhpConfigPrinter\ValueObject\YamlKey;
1616

17-
final class NameOnlyServiceCaseConverter implements CaseConverterInterface
17+
final readonly class NameOnlyServiceCaseConverter implements CaseConverterInterface
1818
{
1919
public function __construct(
20-
private readonly CommonNodeFactory $commonNodeFactory
20+
private CommonNodeFactory $commonNodeFactory
2121
) {
2222
}
2323

src/CaseConverter/NestedCaseConverter/InstanceOfNestedCaseConverter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
use Symplify\PhpConfigPrinter\ValueObject\VariableName;
1616
use Symplify\PhpConfigPrinter\ValueObject\YamlKey;
1717

18-
final class InstanceOfNestedCaseConverter
18+
final readonly class InstanceOfNestedCaseConverter
1919
{
2020
public function __construct(
21-
private readonly CommonNodeFactory $commonNodeFactory,
22-
private readonly ServiceOptionNodeFactory $serviceOptionNodeFactory
21+
private CommonNodeFactory $commonNodeFactory,
22+
private ServiceOptionNodeFactory $serviceOptionNodeFactory
2323
) {
2424
}
2525

src/CaseConverter/ParameterCaseConverter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
*
2323
* parameters: <---
2424
*/
25-
final class ParameterCaseConverter implements CaseConverterInterface
25+
final readonly class ParameterCaseConverter implements CaseConverterInterface
2626
{
2727
public function __construct(
28-
private readonly ArgsNodeFactory $argsNodeFactory,
29-
private readonly CurrentFilePathProvider $currentFilePathProvider,
30-
private readonly CommonNodeFactory $commonNodeFactory
28+
private ArgsNodeFactory $argsNodeFactory,
29+
private CurrentFilePathProvider $currentFilePathProvider,
30+
private CommonNodeFactory $commonNodeFactory
3131
) {
3232
}
3333

src/CaseConverter/ResourceCaseConverter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
use Symplify\PhpConfigPrinter\NodeFactory\Service\ServicesPhpNodeFactory;
1010
use Symplify\PhpConfigPrinter\ValueObject\YamlKey;
1111

12-
final class ResourceCaseConverter implements CaseConverterInterface
12+
final readonly class ResourceCaseConverter implements CaseConverterInterface
1313
{
1414
public function __construct(
15-
private readonly ServicesPhpNodeFactory $servicesPhpNodeFactory
15+
private ServicesPhpNodeFactory $servicesPhpNodeFactory
1616
) {
1717
}
1818

src/CaseConverter/ServicesDefaultsCaseConverter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
use Symplify\PhpConfigPrinter\ValueObject\VariableName;
1515
use Symplify\PhpConfigPrinter\ValueObject\YamlKey;
1616

17-
final class ServicesDefaultsCaseConverter implements CaseConverterInterface
17+
final readonly class ServicesDefaultsCaseConverter implements CaseConverterInterface
1818
{
1919
public function __construct(
20-
private readonly AutoBindNodeFactory $autoBindNodeFactory
20+
private AutoBindNodeFactory $autoBindNodeFactory
2121
) {
2222
}
2323

0 commit comments

Comments
 (0)