登录 注册
其他
10,507
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
PHP
语言
—
创建时间
最近更新

项目能做什么

支持 PHP 5.3+ 代码即时版本升级与自动化重构的工具。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Rector - Instant Upgrades and Automated Refactoring

[![Downloads](https://img.shields.io/packagist/dt/rector/rector.svg?style=flat-square)](https://packagist.org/packages/rector/rector)

<br>

Rector instantly upgrades and refactors the PHP code of your application.  It can help you in 2 major areas:

### 1. Instant Upgrades

Rector now supports upgrades from PHP 5.3 to 8.5 and major open-source projects like [Symfony](https://github.com/rectorphp/rector-symfony), [PHPUnit](https://github.com/rectorphp/rector-phpunit), and [Doctrine](https://github.com/rectorphp/rector-doctrine). Do you want to **be constantly on the latest PHP and Framework without effort**?

Use Rector to handle **instant upgrades** for you.

### 2. Automated Refactoring

Do you have code quality you need, but struggle to keep it with new developers in your team? Do you want to see smart code-reviews even when every senior developers sleeps?

Add Rector to your CI and let it **continuously refactor your code** and keep the code quality high.

Read our [blogpost](https://getrector.com/blog/new-setup-ci-command-to-let-rector-work-for-you) to see how to set up automated refactoring.

## Install

```bash
composer require rector/rector --dev
```

## Running Rector

There are 2 main ways to use Rector:

- a *single rule*, to have the change under control
- or group of rules called *sets*

To use them, create a `rector.php` in your root directory:

```bash
vendor/bin/rector
```

And modify it:

```php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;

return RectorConfig::configure()
    // register single rule
    ->withRules([
        TypedPropertyFromStrictConstructorRector::class
    ])
    // here we can define, what prepared sets of rules will be applied
    ->withPreparedSets(
        deadCode: true,
        codeQuality: true
    );
```

Then dry run Rector:

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

Rector will show you diff of files that it *would* change. To *make* the changes, drop `--dry-run`:

```bash
vendor/bin/rector src
```

## Documentation

* Find [full documentation here](https://getrector.com/documentation/).
* [Explore Rector Rules](https://getrector.com/find-rule)

<br>

## Learn Faster with a Book

Are you curious, how Rector works internally, how to create your own rules and test them and why Rector was born?
Read [Rector - The Power of Automated Refactoring](https://leanpub.com/rector-the-power-of-automated-refactoring) that will take you step by step through the Rector setup and how to create your own rules.

<br>

## Empowered by Community :heart:

The Rector community is powerful thanks to active maintainers who take care of Rector sets for particular projects.

Among there projects belong:

* [palantirnet/drupal-rector](https://github.com/palantirnet/drupal-rector)
* [craftcms/rector](https://github.com/craftcms/rector)
* [FriendsOfShopware/shopware-rector](https://github.com/FriendsO
阅读完整原文

项目深度分析 AI 生成

遗留PHP系统现代化升级与定制规则技术咨询

产品构想依托Rector的AST语法转换能力,面向拥有庞大历史PHP代码(如PHP 5/7升级8+、自研框架转主流框架)的企业,提供工程化迁移与私有规则定制服务。
核心功能代码库迁移风险评估、针对内部私有库的定制Rector规则编写、CI自动化升级流水线配置、单元测试覆盖与变更验证支持。
目标用户拥有长期技术债务的中大型PHP企业、金融/电商类自研系统维护团队。
难度/周期中等 · 1 - 3 个月(按项目计) · 成本:极低(主要为人力与时间成本)
收费模式项目制咨询费、阶段性交付费用、企业培训/私有规则买断。
竞争风险老旧系统缺少测试导致自动化改写出现隐蔽运行时Bug;单人交付规模有限,获客周期较长。
依据 已验证事实

商业垂直生态专用规则订阅包(如Magento/Shopware等电商与ERP)

产品构想针对生态复杂且客单价高的特定PHP商业CMS/电商系统,开发高覆盖度、深度处理破损变更(Breaking Changes)的高级升级规则包,采用订阅制售卖。
核心功能深度AST模式匹配(含模板/配置关联)、复杂废弃API兼容映射、跨大版本无损自动化重构脚本、月度规则维护与工单支持。
目标用户Magento/Shopware/Typo3服务商、独立软件开发商(ISV)、电商自建站技术团队。
难度/周期高 · 2 - 4 个月 · 成本:低(需对特定商业框架生态有深度理解)
收费模式开发者授权许可年费、企业级规则订阅制(SaaS/私有Composer源)。
竞争风险小众生态市场空间有限,维护成本随上游框架频繁迭代而递增。
依据 数据支持的判断

Rector-as-a-Service:云端自动重构与代码现代化PR机器人

产品构想封装Rector为GitHub/GitLab App,免去本地复杂配置,提供代码库一键升级检测、定时自动化提交重构PR及风险解释报告。
核心功能GitHub/GitLab免配置集成、增量代码AST分析、自动创建重构Pull Request、变更风险评级与可视化Diff展示。
目标用户缺乏专职架构师的中小型开发团队、开源项目维护者、希望降低CI维护门槛的技术主管。
难度/周期中等 · 2 - 3 个月 · 成本:低(基础云服务器及计算容器)
收费模式免费版(针对开源/个人)+ 团队按仓库数/按席位月费订阅(Freemium)。
竞争风险企业对源代码外发到第三方SaaS的安全性顾虑(需推测是否需纯私有化部署支持)。
依据 AI推测
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建时间待补全,最近推送 ,发布过 100 个 Release
社区活跃Star 10,507 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。