marc-mabe/php-enum-phpstan
PHPStan extension for marc-mabe/php-enum. Teaches PHPStan about enum accessor methods and allowed values so static analysis understands your enumerations and catches invalid usage. Install with Composer and include the provided extension.neon.
php-enum usage—making it a clear "buy" over "build" for teams already using marc-mabe/php-enum.marc-mabe/php-enum (not native PHP 8.1+ enums), has PHPStan in its toolchain, and prioritizes static type safety for enums. Ideal for medium-to-large codebases with enum-heavy workflows (e.g., payment statuses, role permissions).php-enum <4.0 (incompatible). Also skip if your team lacks PHPStan expertise—this package adds minimal value without static analysis infrastructure.Executives: "This tool catches enum-related bugs before code reaches production—like invalid status values or deprecated references—reducing costly outages and debugging time. It integrates seamlessly with our existing PHPStan setup, requiring minimal effort but delivering high ROI through cleaner code and faster releases."
Engineering: "Adds precise type inference for php-enum methods (getValue(), getValues(), from()) and constants in PHPStan. No more false positives for valid enum usage—just real-time validation of enum values, union types, and deprecations. Works out-of-the-box with 2 lines of config and fits perfectly into CI checks."
How can I help you explore Laravel packages today?