From 5102daf3821d6e61c893296484f828c90e5ff7b0 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 2 Jan 2024 21:13:21 +0000 Subject: [PATCH] bump to next Rector version without Core prefix --- .github/workflows/code_analysis.yaml | 8 -------- composer.json | 20 ++++++++----------- rector.php | 2 +- src/Printer/RuleDefinitionsPrinter.php | 2 +- .../PHPStanRuleCodeSamplePrinter.php | 2 +- .../RectorRuleCodeSamplePrinter.php | 2 +- .../Configurable/ConfigurableRector.php | 2 +- .../DirectConfiguredStringKeyRector.php | 2 +- .../Configurable/WithPHPStanTypeObject.php | 2 +- .../Fixture/Rector/Standard/SomeRector.php | 14 +++++++++++-- .../SomeWhiteSpaceCodeSampleRector.php | 14 +++++++++++-- 11 files changed, 39 insertions(+), 31 deletions(-) diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index b5924e9d..d910e3c5 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -32,14 +32,6 @@ jobs: name: 'Tests' run: vendor/bin/phpunit - - - name: 'PHP Linter' - run: vendor/bin/parallel-lint src tests - - - - name: 'Check Commented Code' - run: vendor/bin/easy-ci check-commented-code src tests --ansi - - name: 'Check Active Classes' run: vendor/bin/class-leak check src --ansi diff --git a/composer.json b/composer.json index 6753af1b..fc8edf6a 100644 --- a/composer.json +++ b/composer.json @@ -7,27 +7,23 @@ ], "require": { "php": ">=8.1", - "symfony/console": "^6.2", + "symfony/console": "^6.4", "nette/robot-loader": "^3.4|^4.0", "symplify/rule-doc-generator-contracts": "^11.1", "nette/utils": "^3.2|^4.0", - "sebastian/diff": "^5.0", - "illuminate/container": "^10.18", + "sebastian/diff": "^5.1", + "illuminate/container": "^10.39", "webmozart/assert": "^1.11", - "symfony/yaml": "^6.3", - "symfony/filesystem": "^6.3" + "symfony/yaml": "^6.4", + "symfony/filesystem": "^6.4" }, "require-dev": { - "phpunit/phpunit": "^10.3", + "phpunit/phpunit": "^10.5", "phpstan/phpstan": "^1.10", "symplify/easy-coding-standard": "^12.0", - "rector/rector": "^0.17", - "symplify/easy-ci": "^11.2", - "php-parallel-lint/php-parallel-lint": "^1.3", + "rector/rector": "dev-main", "tracy/tracy": "^2.10", - "tomasvotruba/class-leak": "^0.1", - "tomasvotruba/unused-public": "^0.3", - "tomasvotruba/cognitive-complexity": "^0.1.1" + "tomasvotruba/class-leak": "^0.2" }, "autoload": { "psr-4": { diff --git a/rector.php b/rector.php index fb1f47b3..e772c276 100644 --- a/rector.php +++ b/rector.php @@ -1,9 +1,9 @@ groupDefinitionsByCategory($ruleDefinitions, $categorizeLevel); $categoryMenuLines = $this->createCategoryMenu($ruleDefinitionsByCategory); - $lines = array_merge($lines, $categoryMenuLines); + $lines = [...$lines, ...$categoryMenuLines]; foreach ($ruleDefinitionsByCategory as $category => $ruleDefinitions) { $lines[] = '## ' . $category; diff --git a/src/RuleCodeSamplePrinter/PHPStanRuleCodeSamplePrinter.php b/src/RuleCodeSamplePrinter/PHPStanRuleCodeSamplePrinter.php index 75bdacad..8948abba 100644 --- a/src/RuleCodeSamplePrinter/PHPStanRuleCodeSamplePrinter.php +++ b/src/RuleCodeSamplePrinter/PHPStanRuleCodeSamplePrinter.php @@ -63,6 +63,6 @@ private function printConfigurableCodeSample( $lines[] = '↓'; $newLines = $this->badGoodCodeSamplePrinter->print($configuredCodeSample); - return array_merge($lines, $newLines); + return [...$lines, ...$newLines]; } } diff --git a/src/RuleCodeSamplePrinter/RectorRuleCodeSamplePrinter.php b/src/RuleCodeSamplePrinter/RectorRuleCodeSamplePrinter.php index 800ed39a..18932f98 100644 --- a/src/RuleCodeSamplePrinter/RectorRuleCodeSamplePrinter.php +++ b/src/RuleCodeSamplePrinter/RectorRuleCodeSamplePrinter.php @@ -4,7 +4,7 @@ namespace Symplify\RuleDocGenerator\RuleCodeSamplePrinter; -use Rector\Core\Contract\Rector\RectorInterface; +use Rector\Contract\Rector\RectorInterface; use Symplify\RuleDocGenerator\Contract\CodeSampleInterface; use Symplify\RuleDocGenerator\Contract\RuleCodeSamplePrinterInterface; use Symplify\RuleDocGenerator\Printer\CodeSamplePrinter\DiffCodeSamplePrinter; diff --git a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/ConfigurableRector.php b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/ConfigurableRector.php index 0b192550..19e82cf7 100644 --- a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/ConfigurableRector.php +++ b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/ConfigurableRector.php @@ -4,7 +4,7 @@ namespace Symplify\RuleDocGenerator\Tests\DirectoryToMarkdownPrinter\Fixture\Rector\Configurable; -use Rector\Core\Contract\Rector\RectorInterface; +use Rector\Contract\Rector\RectorInterface; use Symplify\RuleDocGenerator\Contract\ConfigurableRuleInterface; use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/DirectConfiguredStringKeyRector.php b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/DirectConfiguredStringKeyRector.php index 0143f1ac..6fffc4e5 100644 --- a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/DirectConfiguredStringKeyRector.php +++ b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/DirectConfiguredStringKeyRector.php @@ -4,7 +4,7 @@ namespace Symplify\RuleDocGenerator\Tests\DirectoryToMarkdownPrinter\Fixture\Rector\Configurable; -use Rector\Core\Contract\Rector\RectorInterface; +use Rector\Contract\Rector\RectorInterface; use Symplify\RuleDocGenerator\Contract\ConfigurableRuleInterface; use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/WithPHPStanTypeObject.php b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/WithPHPStanTypeObject.php index 8b04303d..e4e25353 100644 --- a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/WithPHPStanTypeObject.php +++ b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Configurable/WithPHPStanTypeObject.php @@ -5,7 +5,7 @@ namespace Symplify\RuleDocGenerator\Tests\DirectoryToMarkdownPrinter\Fixture\Rector\Configurable; use PHPStan\Type\ObjectType; -use Rector\Core\Contract\Rector\RectorInterface; +use Rector\Contract\Rector\RectorInterface; use Symplify\RuleDocGenerator\Contract\ConfigurableRuleInterface; use Symplify\RuleDocGenerator\Tests\DirectoryToMarkdownPrinter\Source\SomeValueObjectWrapper; use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample; diff --git a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Standard/SomeRector.php b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Standard/SomeRector.php index 657a7040..a5f04702 100644 --- a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Standard/SomeRector.php +++ b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Standard/SomeRector.php @@ -4,11 +4,13 @@ namespace Symplify\RuleDocGenerator\Tests\DirectoryToMarkdownPrinter\Fixture\Rector\Standard; -use Rector\Core\Contract\Rector\RectorInterface; +use PhpParser\Node; +use Rector\Contract\Rector\RectorInterface; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; -final class SomeRector implements RectorInterface +final class SomeRector extends AbstractRector implements RectorInterface { public function getRuleDefinition(): RuleDefinition { @@ -24,4 +26,12 @@ public function getRuleDefinition(): RuleDefinition ), ]); } + + public function getNodeTypes(): array + { + } + + public function refactor(Node $node) + { + } } diff --git a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Standard/SomeWhiteSpaceCodeSampleRector.php b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Standard/SomeWhiteSpaceCodeSampleRector.php index 58673b97..e2813124 100644 --- a/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Standard/SomeWhiteSpaceCodeSampleRector.php +++ b/tests/DirectoryToMarkdownPrinter/Fixture/Rector/Standard/SomeWhiteSpaceCodeSampleRector.php @@ -4,11 +4,13 @@ namespace Symplify\RuleDocGenerator\Tests\DirectoryToMarkdownPrinter\Fixture\Rector\Standard; -use Rector\Core\Contract\Rector\RectorInterface; +use PhpParser\Node; +use Rector\Contract\Rector\RectorInterface; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; -final class SomeWhiteSpaceCodeSampleRector implements RectorInterface +final class SomeWhiteSpaceCodeSampleRector extends AbstractRector implements RectorInterface { public function getRuleDefinition(): RuleDefinition { @@ -26,4 +28,12 @@ public function getRuleDefinition(): RuleDefinition ), ]); } + + public function getNodeTypes(): array + { + } + + public function refactor(Node $node) + { + } }