shipmonk/name-collision-detector
Fast CLI tool to detect duplicate names in PHP code: classes, interfaces, traits, enums, functions, and constants defined multiple times in the same namespace. Scans thousands of files in seconds, supports config/excludes, exits non-zero on collisions.
Architecture fit: Laravel's PSR-4 autoloading structure aligns perfectly with this tool's purpose. The package can be configured to scan app/ and tests/ while excluding vendor/ and generated directories (e.g., storage/), targeting precisely where collisions would cause runtime issues. It addresses edge cases where Laravel's classmap autoloading (e.g., in test directories) might trigger nondeterministic behavior.
Integration feasibility: High. As a Composer dev dependency, it integrates seamlessly into Laravel's existing toolchain. The CLI-based execution fits naturally into CI/CD pipelines and pre-commit hooks. Configuration via collision-detector.json is straightforward and compatible with Laravel's project structure.
Technical risk: Low. The package has active maintenance (latest release March 2024), PHP 8.1+ support matching Laravel 9+, and proven performance (11k files in <1s). However, zero public dependents suggests limited real-world validation outside Shipmonk's ecosystem, though recent fixes (e.g., config validation in 2.1.1) indicate robustness.
Key questions:
How can I help you explore Laravel packages today?