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

Doctrine Value Object Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • Abandonment risk: 13 stars and 0 dependents indicates effectively no production usage signal. Both the bundle and the underlying yokai/doctrine-value-object are single-maintainer projects with limited community scrutiny.
  • DBAL API churn: Doctrine DBAL 2.x → 3.x → 4.x changed type registration and conversion APIs materially. A wrapper pinned to an older DBAL is a blocker at the next framework upgrade.
  • Version-matrix opacity: Symfony and PHP constraint breadth is unknown; a bundle that predates Symfony 6/7 or PHP 8.2+ may require patching.
  • Global type registration: Doctrine custom types are process-global; conflicting or overriding type names across bundles is a real failure mode.
  • Licensing is clean (Apache-2.0), so forking and vendoring is a viable mitigation.

Key questions to resolve before committing.

  1. Which DBAL, ORM, Symfony, and PHP versions are actually supported and tested in CI?
  2. How are types registered — globally, per connection, or via attribute discovery — and can registrations collide or be overridden?
  3. Does it handle nullable value objects, embedded/composite VOs, and VO-to-VO conversion inside query builders and DQL?
  4. What is the test coverage of the underlying yokai/doctrine-value-object, and how recently was either repo released?
  5. Does changing a scalar property to a VO require a schema migration, or is the column mapping identical?
  6. Who is the maintainer, and what is the implied bus factor / succession plan?

Integration Approach

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:

  1. Audit the current Doctrine type registrations and enumerate existing custom types to detect name collisions in advance.
  2. Select one low-traffic bounded context and one value object (an ID or email type is the safest first candidate).
  3. Introduce the VO in the domain layer, map it in Doctrine, and verify round-trip persistence (write, read, query-by-VO) with integration tests.
  4. Because DBAL types usually map to the same underlying column, validate that doctrine:schema:validate reports no drift — if it does, treat that as a blocker requiring a migration plan.
  5. Expand context by context only after the pilot proves stable across a release cycle.

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.

Operational Impact

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:

  • Boot-time failure: container compile errors from type registration or version mismatch — loud and fast, which is the good case.
  • Hydration failure: silent type mismatches or nullability bugs that surface as runtime exceptions on specific rows, the expensive case.
  • Serialization leakage: VOs in Doctrine second-level cache, Symfony serializer payloads, or queue messages may not round-trip without explicit normalizers.
  • Schema drift: migration tooling proposing incorrect column types when a scalar becomes a VO.
  • Upgrade cliff: a framework or DBAL bump renders the bundle incompatible, with no upstream fix forthcoming and a fork required under time pressure.

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.

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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package