ex3v/myclabs-enum-param-converter
A Symfony bundle that adds seamless MyCLabs\Enum parameter conversion in controllers. Install via Composer, register the bundle, typehint enum arguments in actions, and conversion happens automatically.
Architecture fit
The first finding is a category mismatch: despite being scoped as a "Laravel/PHP package," this is a Symfony bundle, not a Laravel package. It registers MyCLabsEnumParamConverterBundle in AppKernel.php and hooks into SensioFrameworkExtraBundle's @ParamConverter annotation pipeline — a Symfony-only extension point. Laravel has no equivalent subsystem; its nearest analogue is implicit route model binding plus FormRequest validation. There is no seam in Laravel's HTTP kernel where this converter's ParamConverterInterface implementation can be registered.
Second, the abstraction it exists to serve is obsolete. MyCLabs\Enum was deprecated in favor of native PHP 8.1 backed enums. The converter solves "how do I cast a route parameter string into a MyCLabs\Enum instance automatically" — a problem native enums plus framework-level binding now solve without a third-party dependency. This package is effectively a shim for a gap that no longer exists in the ecosystem.
Integration feasibility
Not feasible as an integration; only as a reimplementation. The bundle's actual logic is thin (a param converter + service registration, plausibly under ~100 lines), so the practical recommendation is to read it as a reference rather than depend on it. In Laravel, the equivalent is:
enum BarType: string)Route::get('/foo/{barType}', ...) with Laravel's implicit enum binding (Laravel resolves backed enums from route segments automatically in 9+/10+), or an explicit Route::bind()Rule::enum(BarType::class) for FormRequest validationThat is zero new dependencies and less code than the converter itself.
Technical risk
| Risk | Severity | Notes |
|---|---|---|
| Framework mismatch (Symfony vs. Laravel) | Blocking | Cannot be installed meaningfully in Laravel |
Deprecated core dependency (MyCLabs\Enum) |
High | Superseded by native enums; upstream in maintenance/EOL posture |
| Era-appropriate Symfony only | High | AppKernel.php registration implies Symfony 2.8/3.x; Flex-era and Symfony 5+/6+ projects use bundles.php |
| SensioFrameworkExtraBundle annotation layer | High | Annotations deprecated in favor of PHP attributes; the whole @ParamConverter mechanism is on a deprecation path |
| Maintenance signal | Medium | 8 stars, 0 dependents, single maintainer, Travis CI badge (defunct for OSS), README-only maturity, no evidence of a test suite or CI activity |
| Supply-chain exposure | Low | Tiny, auditable surface area; forkable in an afternoon |
The mitigating factor is that low adoption cuts both ways: negligible blast radius, and negligible risk of a breaking upstream change, because nothing upstream is changing.
Key questions
MyCLabs\Enum and this converter.MyCLabs\Enum already present in the dependency tree? If not, adopting this package imports a deprecated transitive dependency for convenience only.SensioFrameworkExtraBundle still installed? If the app has migrated to attributes, the annotation-based usage shown in the README won't fire.Stack fit
Poor. The package assumes Symfony's bundle registration lifecycle and the @ParamConverter annotation reader. In a Laravel codebase it fits at no layer: not the router, not the container's resolution of controller method arguments, not the validation pipeline. For a Symfony codebase it fits only if the app is pre-Flex and still on the annotations driver.
Migration path
For a Laravel target — the stated context — the recommended path is replacement, not integration:
MyCLabs\Enum class to a native enum X: string with a from()/tryFrom() boundary.Rule::enum() in FormRequests.Route::where() constraints or a 404-on-tryFrom failure at the controller boundary to reproduce the converter's "invalid value → not found" behavior.For a Symfony target, the equivalent modernization is: #[MapEntity]/#[ValueResolver] with a custom ValueResolverInterface (replacing ParamConverter), plus native enums. Either way, this package is a source of design intent, not a dependency.
Compatibility
Unverified and likely narrow. The README gives no composer.json constraint excerpt; the AppKernel registration and annotation syntax place it in the Symfony 2.8–3.4 window, which pairs with PHP 7.0–7.4 and MyCLabs\Enum 1.x. Any modern runtime (PHP 8.1+, Symfony 6+, Laravel 10/11) is outside the plausible support envelope. Composer install on a modern stack should be assumed to fail or require --ignore-platform-reqs, which is itself a red flag.
Sequencing
MyCLabs\Enum, @ParamConverter, and enum-typed controller arguments. Confirm whether the need is real or hypothetical.MyCLabs\Enum from the dependency graph in a single, isolated PR.Maintenance
Effectively unmaintained. Single maintainer, 8 stars, 0 dependents, no active CI (Travis CI's free OSS tier is retired, so the badge is decorative), and a README-only maturity rating. There will be no response to a PHP 8.x deprecation notice or a security advisory in a transitive dependency. Adopting it transfers maintenance ownership to your team without the benefit of a stable upstream — the worst of both models. Mitigation: if the functionality is genuinely needed, vendor/fork it and accept ownership explicitly.
Support
No community to escalate to: no dependents means no battle-tested usage patterns, no Stack Overflow corpus, and no third parties to validate behavior against. Internal onboarding depends entirely on reading source. For a shim this small that is acceptable; for anything on a critical request path it is not.
Scaling
Non-issue. A param converter executes once per matched request and does a string-to-enum construction — O(1), no I/O, no allocation pressure beyond the enum instance. This package will never be the bottleneck. The scaling concern is indirect: it pins you to a deprecated enum library, which in turn constrains PHP upgrades, which eventually caps performance work (opcache/JIT gains, framework upgrades).
Failure modes
The notable ones are quiet, which is what makes them worth naming:
TypeError at the typehint, surfacing as a 500 rather than a 404. Easy to misdiagnose as an application bug.@ParamConverter("barType") name; mismatch with the route placeholder produces a null or an unresolved argument.composer install, which is at least loud. Preferable to the silent cases.Ramp-up
Low in absolute terms, high relative to value. The package is small enough that any engineer can read it fully in under an hour, and the Laravel-native replacement is a same-day change. The real ramp-up cost is organizational: convincing stakeholders that adopting a zero-dependent, deprecated-dependency Symfony bundle in a Laravel codebase is the wrong direction, when the alternative is roughly ten lines of native enum binding plus a validation rule. Recommendation: do not adopt; treat as a reference implementation and invest the hour in native enums instead.
How can I help you explore Laravel packages today?