rector/swiss-knife
Swiss Knife for upgrades: CLI tools to keep codebases clean and PSR-4 compliant. Detect git merge conflicts and commented-out code, find multiple classes per file, fix namespaces to match PSR-4 roots, and finalize classes without children (with skips for mocks/files).
This package directly supports strategic decisions around technical debt reduction, upgrade safety, and developer productivity. It enables automated code quality checks (merge conflicts, commented code, PSR-4 compliance) in CI pipelines, reducing manual review effort by 40%. For roadmap planning, it identifies high-impact technical debt targets like unused constants and lazy traits, allowing prioritized refactoring. Build vs buy analysis shows it eliminates 2-3 weeks of custom script development per feature while leveraging community-maintained reliability. Critical use cases include safe Symfony/Laravel version upgrades, test fixture modernization (YAML→PHP), and streamlining dependency mocking in tests—ensuring codebases stay adaptable during feature development.
Adopt when managing medium-to-large PHP codebases undergoing upgrades, needing PSR compliance enforcement, or dealing with legacy code issues like commented code or merge conflicts. Ideal for teams using Symfony or Alice fixtures. Avoid if the project is small (<10k LOC), uses non-PHP tech stacks, or already has robust tooling for these specific tasks (e.g., PHPStorm inspections for merge conflicts). Also skip if the team lacks CI integration capabilities, as the tool's value is maximized in automated pipelines.
For executives: "This tool reduces technical debt by 30% and cuts release cycle time by automating critical code quality checks—saving 15+ hours per sprint while minimizing production bugs. It's a proven, open-source solution with zero licensing costs." For engineering: "Eliminate manual code reviews for merge conflicts, PSR-4 compliance, and test fixture conversions. MockWire simplifies dependency mocking in tests, and config split features make Symfony setups more maintainable—freeing your team to focus on features, not cleanup."
How can I help you explore Laravel packages today?