epwt/array-jms-serializer-bundle
A Symfony bundle that extends JMSSerializerBundle with an Array format, letting you serialize and deserialize data to and from PHP arrays alongside the formats JMS already supports. A small add-on for projects needing array output within the JMS serialization pipeline.
Architecture fit. The package is a Symfony bundle, not a Laravel package. It extends JMSSerializerBundle by registering array as an additional serialization format. In a Laravel codebase there is no Symfony Kernel, bundle registration, or bundle config tree — so the package cannot be installed and used as delivered. Only the underlying concept (registering the array serialization/deserialization visitors with JMS SerializerBuilder) is portable. The dependency chain is also awkward: JMSSerializerBundle itself assumes Symfony, so pulling this in forces a partial Symfony stack into a Laravel app.
Integration feasibility. Low but not zero. JMS Serializer (schmittjoh/serializer) is framework-agnostic and works fine in Laravel, but this bundle is essentially a thin configuration wrapper over JMS's existing ArraySerializationVisitor / ArrayDeserializationVisitor. JMS Serializer already exposes toArray() and fromArray(), which cover the stated use case without any Symfony bundle at all. The realistic integration effort is therefore "reimplement ~20–40 lines of service-provider wiring," not "adopt this package."
Technical risk. High. Signals: 4 stars, 0 dependents, README-only maturity, no stated version constraints, no visible tests or CI. We cannot confirm compatibility with current PHP (8.2+), current JMS Serializer (3.x), or Laravel 10/11. Abandonment risk is effectively certain; treat it as a code sample, not a dependency. Secondary risk: JMS deserialization of untrusted input can instantiate arbitrary classes if type metadata is attacker-influenced — this needs explicit handling regardless of which package supplies the format.
Key questions.
json_decode(..., true) may already satisfy it.toArray()/fromArray() directly?serialize($obj, 'array')) or are the typed helper methods sufficient?Stack fit. Poor as a package; moderate as a pattern. Recommendation: do not add epwt/array-jms-serializer-bundle to composer.json. Instead add jms/serializer directly and, if a named array format is genuinely required, register the Array visitors in a small Laravel service provider wrapping SerializerBuilder.
Migration path.
toArray(), or plain JMS toArray()/fromArray().app/Serialization with a package-owned unit test; do not depend on the upstream repo.Serializer in a service provider with explicit metadata dirs/cache and serialization groups.Compatibility. Unverified upstream; pin PHP and JMS Serializer versions ourselves and validate in CI. Expect to own any fixes.
Sequencing. Proof-of-concept on one non-critical service (e.g., outbound document shaping) → round-trip and performance tests → expand only if it beats JSON/array casting on measured criteria. Keep the serializer behind an interface so a swap to laravel-data or plain arrays is a one-class change.
Maintenance. Effectively a fork. Zero dependents and a README-only maturity signal mean no upstream triage; we would absorb every PHP/JMS upgrade ourselves. Budget a nominal ongoing owner and an upgrade test each time JMS majors.
Support. None. No issue history to lean on, no maintainer SLA, no security advisories channel. Internal documentation and tests become the only safety net.
Scaling. The serializer is stateless and CPU-bound; array output is cheaper than JSON encode/decode, so throughput is fine and horizontal scaling is unaffected. Watch metadata/annotation parsing — cache it in production or cold-start cost will bite under load.
Failure modes.
array silently falling back to JSON-shaped output.Ramp-up. Low for engineers already fluent in JMS Serializer; medium for the team overall given the Symfony-bundle idiom, annotation/attribute metadata, groups, and visitor concepts. Plan a short internal spike and a written convention doc before broad use. Net TPM position: reject the package, adopt the pattern, and cap the investment at a service provider plus tests.
How can I help you explore Laravel packages today?