Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Myclabs Enum Param Converter Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • PHP 8.1+ backed enum (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 validation

That 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

  1. Is the consuming application actually Laravel or Symfony? This determines whether the package is merely stale or categorically unusable.
  2. What PHP version is in production? If 8.1+, native backed enums eliminate the need for both MyCLabs\Enum and this converter.
  3. Is MyCLabs\Enum already present in the dependency tree? If not, adopting this package imports a deprecated transitive dependency for convenience only.
  4. What is the Symfony version, and is SensioFrameworkExtraBundle still installed? If the app has migrated to attributes, the annotation-based usage shown in the README won't fire.
  5. Is there any functional requirement (enum-typed controller arguments) that isn't satisfiable with framework-native features? If no, this is a build-vs-buy question already answered by "build," at trivial cost.

Integration Approach

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:

  1. Convert each MyCLabs\Enum class to a native enum X: string with a from()/tryFrom() boundary.
  2. Delete the param-converter concern entirely; rely on Laravel's implicit enum route binding and Rule::enum() in FormRequests.
  3. Add explicit 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

  1. Inventory — grep the codebase for MyCLabs\Enum, @ParamConverter, and enum-typed controller arguments. Confirm whether the need is real or hypothetical.
  2. Confirm stack and runtime — framework, PHP version, Symfony bundle registration style.
  3. Decide — if Laravel and PHP 8.1+: close as "no action, do not adopt." If a legacy Symfony app genuinely depends on the converter: fork it into an internal namespace, since the code volume is small and the upstream is not maintained.
  4. Remediate — migrate to native enums behind a compatibility boundary; remove MyCLabs\Enum from the dependency graph in a single, isolated PR.
  5. Verify — regression-test route/controller behavior for invalid enum values, since the failure semantics (404 vs. 400 vs. 500) are the observable contract worth preserving.

Operational Impact

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:

  • Bundle not registered → converter silently absent; the controller receives a string and throws a TypeError at the typehint, surfacing as a 500 rather than a 404. Easy to misdiagnose as an application bug.
  • Invalid enum value in the URL → the converter typically converts a construction failure into a 404, which conflates "resource missing" with "malformed input." Preserve or deliberately change this semantic during replacement; clients may depend on it.
  • Route parameter name drift — the converter keys off the @ParamConverter("barType") name; mismatch with the route placeholder produces a null or an unresolved argument.
  • Annotation driver disabled — Symfony Flex-era apps default to attributes; the annotation reader may not be configured, and the converter never runs, failing as above.
  • PHP/framework upgrade → hard failure at 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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core