upscale/doctrine-value-object-bundle
A Symfony bundle that simplifies persisting value objects with Doctrine. It ships DBAL types and mapping helpers so value objects can be stored directly in entities, eliminating repetitive primitive conversion code and keeping domain models expressive, type-safe, and clean.
Architecture fit. This is a thin Symfony integration layer over yokai/doctrine-value-object, whose job is to wire Doctrine DBAL custom types for value objects through Symfony's DI container (compiler pass + service configuration). It assumes a Doctrine ORM/DBAL stack and a codebase that already treats value objects as first-class domain primitives (DDD-leaning, hexagonal, or strongly typed domain layers). If the application models money, IDs, emails, or quantities as scalars today, the bundle only becomes relevant after a domain-modeling decision, not before. For teams without that convention, the bundle adds dependency surface with no immediate payoff.
Integration feasibility. Mechanically low-risk to trial: composer require, register the bundle in config/bundles.php (or AppKernel), and configure type mappings. There is no evidence of a Symfony Flex recipe, so expect manual registration. The real integration surface is Doctrine's type registry, which is global and order-sensitive — a misconfiguration surfaces at container compile or first hydration, not at install time. A time-boxed spike in one bounded context is a reasonable feasibility test.
Technical risk. High relative to the bundle's own code complexity, because risk concentrates in the dependency chain rather than the wrapper:
yokai/doctrine-value-object are single-maintainer projects with limited community scrutiny.Key questions to resolve before committing.
yokai/doctrine-value-object, and how recently was either repo released?Stack fit. Appropriate only for Symfony applications already on Doctrine ORM with an established value-object convention. It is a poor fit for greenfield projects that have not yet committed to a domain-modeling style, and irrelevant for non-Symfony or non-Doctrine stacks. Confirm the application's DBAL major version first — that single fact determines whether the bundle is usable as-is or must be forked.
Migration path. Adopt incrementally, never as a big-bang refactor:
doctrine:schema:validate reports no drift — if it does, treat that as a blocker requiring a migration plan.Compatibility. Pin exact versions in composer.json for both the bundle and yokai/doctrine-value-object; do not rely on caret ranges for low-adoption packages. Verify CI against the DBAL and Symfony majors in the target upgrade path. If constraints block the current stack, vendor a fork under an internal namespace — Apache-2.0 permits this — and own the patch.
Sequencing. Gate the decision behind the pilot: run the spike, measure the patch surface required to fit the current stack, and only then decide between adopt, fork, or roll an internal ~200-line compiler pass and type wrapper. For a wrapper this thin, the build-vs-fork-vs-adopt calculus often favors forking an existing implementation over adopting an unmaintained one.
Maintenance. Expect to own this code eventually. Two low-activity dependencies in series (bundle → library) double the surface you must track for security advisories, PHP deprecations, and DBAL/Symfony upgrades. Budget a recurring line item for dependency review, and assign a named internal owner before adoption. Fork-and-vendor is the realistic end state, not a contingency.
Support. No vendor, no SLA, no commercial backing. Support is GitHub issues on a repo with 13 stars, which in practice means self-support. Internal documentation of the registration mechanism, the type-name namespace convention, and the upgrade procedure is mandatory — it cannot be reconstructed from community resources.
Scaling. Runtime cost is negligible: type conversion is a thin hydration/dehydration layer with no meaningful throughput penalty at typical application scale. The scaling concern is organizational, not computational — the pattern spreads by convention, so the number of teams touching Doctrine mappings grows while the number of people who understand the type registry stays small. Centralize the convention early.
Failure modes. Plan for:
Ramp-up. The bundle itself is learnable in hours; the real ramp is team fluency in Doctrine custom types and value-object modeling, which is a multi-sprint skill investment for developers without DDD exposure. Assume one experienced engineer as the internal authority and a written onboarding note. Given zero dependents and no community corpus, that internal knowledge cannot be outsourced to search results.
Recommendation summary. Do not adopt as a default dependency. Treat it as a candidate for a one-context pilot if the team is already committed to value objects and the version matrix checks out; otherwise fork the implementation internally or defer until the underlying library shows maintenance activity.
How can I help you explore Laravel packages today?