friendsofhyperf / rector
Rector upgrades rules for Hyperf.
Fund package maintenance!
huangdijia
hdj.me/sponsors
Installs: 34 192
Dependents: 5
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 3
Open Issues: 0
Type:rector-extension
Requires
- php: >=8.0
- rector/rector: ^1.0|^2.0
Requires (Dev)
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.8.2
- phpstan/phpstan-strict-rules: ^1.2
- phpstan/phpstan-webmozart-assert: ^1.1
- phpunit/phpunit: ^10.0
- rector/rector-debugging: dev-main
- symplify/easy-coding-standard: ^11.0
- symplify/phpstan-extensions: ^11.0
- symplify/phpstan-rules: ^11.0
- symplify/rule-doc-generator: ^11.0
- symplify/vendor-patches: ^11.0
README
See available Hyperf rules
Install
This package is a Rector extension developed by the Hyperf community.
Install the package as dependency:
composer require friendsofhyperf/rector --dev
Use Sets
To add a set to your config, use Rector\Hyperf\Set\HyperfSetList
class and pick one of the constants:
use Rector\Hyperf\Set\HyperfSetList; use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { $rectorConfig->sets([ HyperfSetList::HYPERF_31 ]); };
Run Rector
the source directory (e.g. src
) is optional.
1. Dry Run - Preview Changes
vendor/bin/rector process src --dry-run
2. Run Rector and Let It Change Your Code
vendor/bin/rector process src
Learn Rector Faster
Rector is a tool that we develop and share for free, so anyone can save hundreds of hours on refactoring. But not everyone has time to understand Rector and AST complexity. You have 2 ways to speed this process up:
- read a book - The Power of Automated Refactoring
- hire our experienced team to improve your codebase
Both ways support us to and improve Rector in sustainable way by learning from practical projects.