awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
rectorphp avatar

rectorphp/rector

0
View on GitHub↗
10,199 星标·739 分支·PHP·mit·3 次浏览getrector.com↗

Rector

Rector is an automated PHP refactoring and modernization tool designed to upgrade language versions and modernize syntax using predefined rules. It functions as a static analysis engine that inspects code structures and types to identify refactoring targets without executing the code.

The project provides a framework for defining custom transformation logic to automate project-specific changes. It distinguishes itself by offering specialized capabilities for migrating legacy or custom frameworks to modern alternatives and converting docblock annotations into native language attributes.

The system covers broad capability areas including dead code elimination, automated type hinting, and class visibility optimization. It also manages codebase standardization through namespace restructuring and the removal of redundant code artifacts.

The tool includes command-line utilities for previewing changes via diffs and integrating refactoring workflows into continuous integration pipelines.

Features

  • Automated Code Refactoring - Automatically applies structural changes to PHP code to upgrade language versions and improve maintainability.
  • Code Refactoring Tools - Implements a comprehensive suite of utilities for restructuring and modernizing PHP source code via predefined rulesets.
  • Language Version Migrations - Automatically updates PHP codebases from older versions to current releases to leverage new language features and syntax.
  • Dead Code Elimination - Identifies and eliminates unused code to improve general coding style and reduce technical debt.
  • Version Migration Utilities - Provides tools to facilitate the migration of codebases between major language and framework versions.
  • PHP Development Tools - Provides an automated tool for modifying PHP source code to upgrade language versions and modernize syntax.
  • Annotation to Attribute Migrations - Transforms docblock annotations into native language attributes by identifying attribute classes in project dependencies.
  • Codebase Modernizers - Updates legacy PHP codebases to leverage modern language features and runtime versions through automated refactoring.
  • Automated Type Hinting - Adds native type hints and docblock types to parameters, returns, and variables to increase coverage.
  • Code Transformation Engines - Provides a rule-based engine that automates structural code modifications via syntax tree transformations.
  • Code Transformation Tools - Implements structural code modifications by parsing PHP grammars into abstract syntax trees.
  • Custom Analysis Rules - Provides a framework for defining custom, metadata-driven rules to automate the replacement of outdated code patterns.
  • Version Compatibility Analyzers - Includes static analysis rules that ensure code is compatible with specific target language versions.
  • Framework Migrations - Transforms code from a custom or legacy framework to a modern open-source alternative to eliminate technical debt.
  • Framework Migrations - Provides specialized capabilities for migrating code from legacy or custom frameworks to modern open-source alternatives.
  • AST Node Metadata - Stores contextual information on AST nodes during traversal for use by subsequent refactoring rules.
  • Multi-Pass AST Traversals - Processes the code hierarchy in multiple stages to resolve complex dependencies and apply incremental changes.
  • Automated Type Hinting - Uses static analysis to automatically add native PHP type declarations and docblock types to parameters and return values.
  • Static Analysis Engines - Uses a static analysis engine to inspect PHP code structures and types to identify refactoring targets.
  • Technical Debt Management - Identifies and removes dead code, commented-out blocks, and outdated patterns to reduce technical debt.
  • Static Reflection - Inspects classes using static reflection to avoid executing the code or requiring a functional autoload setup.
  • Static Code Analysis - Analyzes variable and method types using static tools to ensure refactoring changes apply only to intended classes.
  • Parsed Code Caching - Stores parsed code objects on disk to avoid reprocessing unchanged files in subsequent runs.
  • Analysis Result Caches - Stores parsed code objects between executions to avoid re-parsing unchanged files and accelerate subsequent runs.
  • External Ruleset Integrations - Allows the import of external or community-authored refactoring rules to extend the tool's capabilities.
  • Version-Aware Rulesets - Automatically selects the appropriate refactoring rules by detecting installed package versions.
  • Refactoring Scope Control - Enables precise control over which files, paths, or rules are applied during the refactoring process.
  • Structural Change Previews - Generates a diff of proposed structural modifications for verification before applying them to source files.
  • Tool Execution Optimizers - Speeds up execution by configuring parallel processing and managing cache directories to process only changed files.
  • Visibility Optimizations - Finalizes classes and privatizes constants that are not used outside their containing class.
  • Rule Package Distributions - Automatically loads specialized collections of refactoring rules based on the versions of installed packages.
  • Transformation Rule Frameworks - Offers a framework for defining and executing specialized transformation logic to automate project-specific code changes.
  • Namespace Standardization - Converts random namespaces to a standard structure by updating configurations, class names, and imports.
  • Parallel Processing - Reduces processing time for large codebases by running tasks simultaneously across multiple CPU cores.
  • Refactoring Safety Controls - Provides controls to prevent the modification of public and non-final elements, balancing refactoring depth with risk.
  • Static Analysis Extensions - Integrates external analysis configurations and container metadata to improve the precision of type-based refactorings.
  • Code Quality Tools - Detects commented-out code and fake traits to remove technical debt and maintain high software quality.
  • Code Analysis and Refactoring - Automates code upgrades and refactoring tasks.

Star 历史

rectorphp/rector 的 Star 历史图表rectorphp/rector 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Rector 的开源替代方案

相似的开源项目,按与 Rector 的功能重合度排序。
  • openrewrite/rewriteopenrewrite 的头像

    openrewrite/rewrite

    3,312在 GitHub 上查看↗

    OpenRewrite is an automated refactoring engine and source-to-source migration framework. It uses a lossless semantic tree parser to represent source code as type-aware trees that preserve original whitespace and formatting, enabling precise and deterministic modifications. The project utilizes a declarative refactoring pipeline where sequences of transformations are defined in YAML to resolve breaking changes and technical debt. It features type-aware pattern matching and cross-language model mapping to apply similar refactoring patterns across different programming languages. The framework

    Javaabstract-syntax-treeastcode-search
    在 GitHub 上查看↗3,312
  • php-cs-fixer/php-cs-fixerPHP-CS-Fixer 的头像

    PHP-CS-Fixer/PHP-CS-Fixer

    13,463在 GitHub 上查看↗

    This tool is a command-line utility designed to automatically detect and correct coding standard violations in PHP source files. It functions as a static analysis and refactoring engine that ensures consistent project-wide formatting by applying predefined community conventions or custom organizational rules. The project distinguishes itself through a modular rule-based engine that supports both automated style correction and codebase modernization. It allows developers to update legacy syntax to align with newer language versions and testing framework requirements, facilitating the adoption

    PHPcode-standardscode-stylephp
    在 GitHub 上查看↗13,463
  • phpstan/phpstanphpstan 的头像

    phpstan/phpstan

    13,999在 GitHub 上查看↗

    This project is a static analysis engine and type checker designed for PHP codebases. It evaluates source code structure and type annotations to identify potential bugs, type mismatches, and logic errors without executing the application. By parsing code into an abstract syntax tree and applying a rule-based validation framework, it enforces code quality and safety standards across a project. What distinguishes this tool is its sophisticated type inference engine, which models dynamic language features, magic methods, and conditional types to maintain accuracy even in unconventional code. It

    PHPphpphp7phpstan
    在 GitHub 上查看↗13,999
  • rrrene/credorrrene 的头像

    rrrene/credo

    5,193在 GitHub 上查看↗

    Credo is a static analysis tool and linter for Elixir. It functions as a code quality analyzer that scans source code to identify stylistic inconsistencies, common mistakes, and potential security vulnerabilities. The tool provides a customizable framework for defining and testing specialized rules to enforce project-specific coding standards. It identifies complex code fragments and duplication to highlight opportunities for refactoring and simplification. Its capabilities cover automated code reviews, the enforcement of Elixir coding standards, and real-time developer feedback through edit

    Elixir
    在 GitHub 上查看↗5,193
查看 Rector 的所有 30 个替代方案→

常见问题解答

rectorphp/rector 是做什么的?

Rector is an automated PHP refactoring and modernization tool designed to upgrade language versions and modernize syntax using predefined rules. It functions as a static analysis engine that inspects code structures and types to identify refactoring targets without executing the code.

rectorphp/rector 的主要功能有哪些?

rectorphp/rector 的主要功能包括:Automated Code Refactoring, Code Refactoring Tools, Language Version Migrations, Dead Code Elimination, Version Migration Utilities, PHP Development Tools, Annotation to Attribute Migrations, Codebase Modernizers。

rectorphp/rector 有哪些开源替代品?

rectorphp/rector 的开源替代品包括: openrewrite/rewrite — OpenRewrite is an automated refactoring engine and source-to-source migration framework. It uses a lossless semantic… php-cs-fixer/php-cs-fixer — This tool is a command-line utility designed to automatically detect and correct coding standard violations in PHP… phpstan/phpstan — This project is a static analysis engine and type checker designed for PHP codebases. It evaluates source code… rrrene/credo — Credo is a static analysis tool and linter for Elixir. It functions as a code quality analyzer that scans source code… analysis-tools-dev/static-analysis — This project is a comprehensive, curated directory of static analysis, linting, and security scanning utilities. It… voltagent/awesome-claude-code-subagents — This project provides a framework for managing multi-agent systems, designed to automate complex software development,…