stickee/rector-config
A shared Rector configuration package from Stickee for Laravel/PHP projects, offering reusable rules and presets to automate code upgrades, enforce consistency, and simplify maintaining modern codebases across repositories.
composer require --dev stickee/rector-config
A Rector config package normally ships a shared rector.php (or a base ruleset class) so teams don't copy-paste rule definitions between projects. Expect two integration paths:
Import the base config from your project root rector.php:
<?php
use Rector\Config\RectorConfig;
return RectorConfig::configure()
->withPaths([__DIR__ . '/app', __DIR__ . '/src'])
->withPreparedSets(
// if the package exposes a set constant
// \Stickee\Rector\Set\StickeeSetList::STICKEE_STRICT
);
Or, if it ships a plain config file, withSets([__DIR__ . '/vendor/stickee/rector-config/rector.php']).
Check the README first — with 0 stars and 0 dependents this is a very small (likely internal-first) package; the composer autoload/extra section and the repo's rector.php will tell you more than any docs will.
Your first useful use case: run it in dry-run on a single directory before touching a whole codebase.
vendor/bin/rector process app/ --dry-run
Read the diff, confirm the rules match your team's style conventions, then remove --dry-run. Because this is effectively a one-maintainer config wrapper, treat the first run as an audit of the ruleset, not just your code.
"stickee/rector-config": "1.2.3") rather than ^ if you want reproducible refactors across repos.--only/withPaths() to the diff. Fail the build on a non-empty dry-run if you want to force cleanup, or just report it.composer rector:check (dry-run) locally, apply with vendor/bin/rector process <path>, review the diff, commit. Keep the apply step manual — auto-applying Rector in a hook creates noisy commits.rector.php. Don't edit files under vendor/. If you need a rule the package doesn't ship, add it alongside; upstream it later.->withPhpSets(php82: true) (or whatever your runtime is) in addition to the package's set. The package config likely assumes a PHP baseline; verify it matches yours.withSets() that silently no-ops if the class name changed between Rector versions. If nothing changes after a run, confirm the set is actually loaded (vendor/bin/rector list / verbose output).--dry-run is non-negotiable on first use. Rector rules can be opinionated (e.g. aggressive type declarations, removing docblocks). The package encodes someone's conventions. Diff against a small module before rolling across the monorepo, and check whether the ruleset assumes strict types or specific PHPStan/PHPCS alignment.var/cache/rector). After editing rector.php or bumping the package, clear the cache (vendor/bin/rector process --clear-cache) or you'll debug phantom behaviour.config scaffolding guaranteed. Some packages ship a rector.dist.php you're meant to copy; others export a class. Check composer.json autoload and the repo tree — the README may be thin. If there's a src/ with a Set/ namespace, you're meant to reference a constant; if it's just rector.php, you're meant to withSets() the file path.--only=<Rule::class> from the dry-run output (--debug prints applied rules). If a rule from this package misfires, the escape hatch is to skip it by name in your own config rather than forking the vendor package.RectorConfig builder. If your needs diverge, copy its two or three rules into a local rector.php and drop the dependency — you lose nothing but the update stream, and you gain full control (worth it when adoption is this low).tools/ is a reasonable long-term move.Verdict for day-to-day use: adopt only if you're already in the Stickee/PHP-Rector ecosystem and want a shared baseline; verify by reading the (short) source before relying on it. For everyone else, a hand-rolled rector.php with the same prepared sets gives the same benefit with none of the single-maintainer risk.
How can I help you explore Laravel packages today?