- How do I install wyrihaximus/rector-config in a Laravel project?
- Install it with Composer as a dev dependency using composer require wyrihaximus/rector-config --dev. Then create or edit your rector.php file so it returns WyriHaximus\RectorPHP\RectorConfig::configure(dirname(__DIR__, 2)). Because it is dev-only, nothing is added to your Laravel application's runtime code path, but you should still confirm it stays out of your production autoload graph.
- What does wyrihaximus/rector-config add on top of stock Rector?
- It is a configuration distribution rather than a library with its own public API. It provides a RectorConfig with sensible defaults for the etc, examples, src, and tests directories, and it converts supported doc tags into attributes. It also bundles a handful of additional custom rules that encode the author's own style preferences. Everything it does depends on Rector being installed and run first.
- How do I configure wyrihaximus/rector-config in rector.php?
- The documented usage is a single return statement calling RectorConfig::configure() with your project root, for example dirname(__DIR__, 2). You can then layer your own paths, sets, or skips on top of that config in the same file. Treat that registration line as a private API surface, because there is no compatibility contract guaranteeing it stays stable across upgrades.
- Does wyrihaximus/rector-config support my Laravel version?
- The package is not tied to a Laravel release; it is a dev-time Rector configuration, so Laravel version support is not the real constraint. What matters is its PHP floor and which Rector major it targets, since those determine whether it installs and runs in your project. If your Laravel app runs a PHP version that satisfies the package and Rector constraints, it should work regardless of the Laravel version.
- Will wyrihaximus/rector-config affect my production Laravel application?
- No, provided you install it with --dev as documented. Rector is a development-time AST refactoring tool, so this package does not participate in the request path, affect autoloading at runtime, or ship code to production. The main thing to verify at install time is that it contributes nothing to the production autoload graph or runtime dependency tree.
- Does wyrihaximus/rector-config add runtime dependencies to my Composer graph?
- It is intended to be installed as a dev dependency, and the documented installation uses composer require --dev. You should still inspect its Composer constraints to confirm its dependencies are declared under require-dev rather than require. If it drags runtime dependencies into your production graph, treat that as a stop condition rather than an acceptable trade-off.
- How do I test which Rector rules fire before applying changes?
- Run Rector in dry-run mode against one medium-sized, actively maintained repository and capture the rule hit list and diff volume. That measurement tells you which of the package's rules actually fire on your codebase and how many produce false positives. Only after reviewing that output should you consider applying changes or rolling the config out to other repositories.
- Which Rector and PHP versions does wyrihaximus/rector-config support?
- The package targets a specific Rector major and has its own PHP floor, so check its Composer constraints before installing. There is no documented long-term compatibility window or historical lag after Rector majors, which means every upgrade of Rector or this package is a manual verification event. Pin versions in CI and re-run the dry-run check whenever either side moves.
- Is wyrihaximus/rector-config actively maintained?
- It is a single-maintainer package with no vendor or formal support path, and it has very low independent adoption, so abandonment risk is real. The author is a long-standing PHP open source contributor with a strict internal engineering bar, which reduces but does not eliminate that risk. Treat any recent release date as unverified and do not read it as a maintenance commitment.
- What are the alternatives to wyrihaximus/rector-config?
- The most direct alternative is a hand-rolled rector.php preset that you own and control, which is realistically less than a day of work. You can also use Rector's own level sets or community Laravel-oriented Rector packages instead of a personal configuration distribution. Choose based on whether the bundled rules are load-bearing for codemods you cannot reproduce yourself.