PHPackages                             friendsofhyperf/rector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. friendsofhyperf/rector

ActiveRector-extension[Utility &amp; Helpers](/categories/utility)

friendsofhyperf/rector
======================

Rector upgrades rules for Hyperf.

v0.2.1(1y ago)442.5k↓25%34MITPHPPHP &gt;=8.0

Since Apr 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/friendsofhyperf/rector)[ Packagist](https://packagist.org/packages/friendsofhyperf/rector)[ Fund](https://hdj.me/sponsors/)[ GitHub Sponsors](https://github.com/huangdijia)[ RSS](/packages/friendsofhyperf-rector/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (12)Versions (9)Used By (4)

Rector Rules for Hyperf
=======================

[](#rector-rules-for-hyperf)

[![Latest Stable Version](https://camo.githubusercontent.com/c3361470ac07a5648d6296de6c3b5e066a69d9b147025fd425ebb10b5a25c796/68747470733a2f2f706f7365722e707567782e6f72672f667269656e64736f666879706572662f726563746f722f76657273696f6e2e706e67)](https://packagist.org/packages/friendsofhyperf/rector)[![Total Downloads](https://camo.githubusercontent.com/074034958105403636ec61c03a1424764ee12875d70720af5b96b61badf94ab2/68747470733a2f2f706f7365722e707567782e6f72672f667269656e64736f666879706572662f726563746f722f642f746f74616c2e706e67)](https://packagist.org/packages/friendsofhyperf/rector)[![GitHub license](https://camo.githubusercontent.com/fd95b4158c15a9bf25fe0f9c109c0fb4ec8300ca52d645b69a62eb6a2cf2629c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f667269656e64736f666879706572662f726563746f72)](https://github.com/friendsofhyperf/rector)

See available [Hyperf rules](/docs/rector_rules_overview.md)

Install
-------

[](#install)

This package is a [Rector](https://github.com/rectorphp/rector) extension developed by the Hyperf community.

Install the package as dependency:

```
composer require friendsofhyperf/rector --dev
```

Use Sets
--------

[](#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
----------

[](#run-rector)

the source directory (e.g. `src`) is optional.

### 1. Dry Run - Preview Changes

[](#1-dry-run---preview-changes)

```
vendor/bin/rector process src --dry-run
```

### 2. Run Rector and Let It Change Your Code

[](#2-run-rector-and-let-it-change-your-code)

```
vendor/bin/rector process src
```

Learn Rector Faster
-------------------

[](#learn-rector-faster)

Rector is a tool that [we develop](https://getrector.org/) 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](https://leanpub.com/rector-the-power-of-automated-refactoring)
- hire our experienced team to [improve your codebase](https://getrector.org/contact)

Both ways support us to and improve Rector in sustainable way by learning from practical projects.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~81 days

Recently: every ~139 days

Total

8

Last Release

551d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8337659?v=4)[Deeka Wong](/maintainers/huangdijia)[@huangdijia](https://github.com/huangdijia)

---

Top Contributors

[![huangdijia](https://avatars.githubusercontent.com/u/8337659?v=4)](https://github.com/huangdijia "huangdijia (27 commits)")[![xuanyanwow](https://avatars.githubusercontent.com/u/28777109?v=4)](https://github.com/xuanyanwow "xuanyanwow (2 commits)")[![deluxetom](https://avatars.githubusercontent.com/u/6439307?v=4)](https://github.com/deluxetom "deluxetom (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/friendsofhyperf-rector/health.svg)

```
[![Health](https://phpackages.com/badges/friendsofhyperf-rector/health.svg)](https://phpackages.com/packages/friendsofhyperf-rector)
```

###  Alternatives

[frosh/shopware-rector

Shopware specific Rector

47394.3k5](/packages/frosh-shopware-rector)[codeigniter4/devkit

Development toolkit for CodeIgniter libraries and projects

68187.1k82](/packages/codeigniter4-devkit)[quartetcom/static-analysis-kit

Strict and modern kit to optimise the codebase defensively.

144.3k5](/packages/quartetcom-static-analysis-kit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
