# rectorphp/rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code

Repository: https://github.com/rectorphp/rector
Canonical: https://ross.abutalabs.com/products/rector
Homepage: https://getrector.com
Language: PHP
License: MIT
License Family: permissive
Topics: php, ast, instant-upgrades, automated-upgrades, upgrade, rector
Last push: 2026-08-26T20:42:25+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 86, longevity 100
- inputs: {"age_days": 3336, "days_push": 7, "days_rel": 15, "gap_med": 6, "n_releases_24m": 76}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 10407, forks 743 (observed 2026-08-28T04:10:41.927788+00:00)

## What it is
Rector is a PHP CLI tool that performs instant upgrades and automated refactoring of PHP codebases using AST-based rules. It supports upgrades from PHP 5.3 to 8.5 and framework migrations for projects like Symfony, PHPUnit, and Doctrine.

## Use cases
- upgrade php codebase to php 8
- automatically migrate symfony framework version
- refactor legacy php code automatically
- run automated code quality checks in ci
- upgrade phpunit tests to latest version
- modernize legacy php 5.3 application

## When to choose
- you need to upgrade PHP or framework versions with minimal manual effort
- you want continuous automated refactoring in CI to maintain code quality
- you maintain a large legacy PHP codebase that needs modernization

## When to avoid
- your project is not written in PHP
- you need one-off manual refactoring with full human control over every change
- your codebase is untyped procedural code with no OOP structure, where Rector works less effectively

## Facets
- artifact type: cli-tool
- maturity: active
- function: developer-tools, build-tool, code-review, parser
- domain: developer-tools, programming-languages, web-development
- platform: php, cli, cross-platform
- tags: php-ast, automated-refactoring, code-upgrades, legacy-modernization, static-analysis, automation

## Member repositories
- rectorphp/rector (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:41.927788+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:19:03.951027+00:00, confidence not recorded.
  - readme: https://github.com/rectorphp/rector (fetched 2026-08-28T04:10:41.927788+00:00, sha 071c5087a3a2)
  - homepage: https://getrector.com (fetched 2026-08-29T08:18:11.267172+00:00, sha 1df83eeab931)
  - site_page: https://getrector.com/documentation (fetched 2026-08-29T08:18:11.269892+00:00, sha 7c2e12878352)
- Data as of 2026-08-30T08:39:29.467469+00:00.
