Skip to content

Commit

Permalink
Upgrade to Rector v1 (#2)
Browse files Browse the repository at this point in the history
* Allow rector v1

* Upgrade to rector 1

* config

* not needed

* Added ECS back

* Add symplify/phpstan-extensions dependency

* Add symplify/rule-doc-generator to composer.json

---------

Co-authored-by: Deeka Wong <[email protected]>
  • Loading branch information
deluxetom and huangdijia committed Apr 2, 2024
1 parent 07c4db9 commit a574ef9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
6 changes: 2 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Rector upgrades rules for Hyperf.",
"require": {
"php": ">=8.0",
"rector/rector": "^0.15.12"
"rector/rector": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
Expand All @@ -14,7 +14,6 @@
"symplify/phpstan-extensions": "^11.0",
"symplify/easy-coding-standard": "^11.0",
"symplify/rule-doc-generator": "^11.0",
"rector/phpstan-rules": "^0.6",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-webmozart-assert": "^1.1",
"phpstan/phpstan-strict-rules": "^1.2",
Expand All @@ -37,8 +36,7 @@
"check-cs": "vendor/bin/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --ansi",
"docs": [
"vendor/bin/rule-doc-generator generate src --output-file docs/rector_rules_overview.md --ansi",
"vendor/bin/ecs check-markdown docs/rector_rules_overview.md --ansi --fix"
"vendor/bin/rule-doc-generator generate src --output-file docs/rector_rules_overview.md --ansi"
]
},
"minimum-stability": "dev",
Expand Down
20 changes: 0 additions & 20 deletions config/config.php

This file was deleted.

3 changes: 0 additions & 3 deletions config/sets/hyperf31.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;

use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Renaming\ValueObject\MethodCallRename;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../config.php');

$rectorConfig
->ruleWithConfiguration(RenameClassRector::class, [
// AsyncQueue
Expand Down
10 changes: 10 additions & 0 deletions config/sets/up-to-hyperf31.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Hyperf\Set\HyperfSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([HyperfSetList::HYPERF_31]);
};
1 change: 1 addition & 0 deletions src/Set/HyperfLevelSetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@

final class HyperfLevelSetList implements SetListInterface
{
public const UP_TO_HYPERF_31 = __DIR__ . '/../../config/sets/up-to-hyperf31.php';
}

0 comments on commit a574ef9

Please sign in to comment.