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 Relations Analyser Laravel Package

huluti/doctrine-relations-analyser

Doctrine Relations Analyser inspects Doctrine ORM entity associations to flag missing or misconfigured relations—such as absent inversedBy/mappedBy, cascade, orphanRemoval, and nullable settings—helping you catch mapping issues early and keep your model consistent.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package is a Symfony bundle, not a Laravel package. It operates on Doctrine ORM metadata (entity mappings, owning/inverse sides, cascade and orphan-removal configuration). Laravel's default persistence layer is Eloquent, which exposes no equivalent metadata graph, so there is no direct architectural fit for a standard Laravel application.
  • Realistic fit is limited to: (a) Symfony services in a polyglot PHP estate, (b) Laravel apps running laravel-doctrine / Doctrine ORM as the primary mapper, (c) shared libraries consumed by both. Note that doctrine/dbal alone is not sufficient — this tool needs full ORM entity metadata.
  • For an Eloquent-only estate, treat this as a pattern reference (relation-hygiene checks) rather than a dependency; the equivalent capability would be a bespoke Artisan command over Model::resolveRelationUsing / reflection.
  • 0.8.0 does not change this. Symfony 8 support is a framework-compatibility expansion only; it does not introduce an Eloquent adapter or any non-Doctrine analysis path.

Integration feasibility

  • Low effort: composer require --dev, register the bundle in config/bundles.php for dev/test only, invoke the console command in CI. Expect no Symfony Flex recipe, so manual registration is required.
  • Because it is a dev-time analysis tool, blast radius is small: nothing ships to production, no runtime code path changes, no schema or data migration.
  • Spike estimate: 1–2 engineer-days to validate output quality against a real entity graph and wire a CI job. Unchanged by 0.8.0.

Technical risk

  • Single-maintainer / low-adoption risk: still ~15 stars, 0 dependents, no downstream validation, no evidence of production use at scale.
  • Mitigating factors: MIT license, small and self-contained codebase, dev-only scope — cheap to fork, vendor, or replace. The 0.8.0 release (Symfony 8 support, published promptly against the framework's release line) is a positive maintenance signal: the maintainer is tracking current framework versions rather than letting constraints rot.
  • Version-matrix risk (partially reduced): 0.8.0 adds Symfony 8 support, closing the framework-compatibility gap flagged previously. Two caveats remain: (a) Symfony 8 implies a PHP 8.4 floor, so the bundle will not be installable on older PHP runtimes — older projects must pin to the 0.7.x line, and the constraint should be verified against each service's PHP version; (b) Doctrine ORM 2.x → 3.x metadata API changes remain unaddressed by the release notes and are still the more material compatibility question for this tool, since it reads ORM metadata directly.
  • Correctness risk (unchanged): static relation analysis is heuristic. False positives (intentional unidirectional relations, legacy mappings) and false negatives (inheritance, embeddables, trait-composed mappings, multi-bundle mapping config) are expected.
  • No breaking changes, no deprecations, no behavioural changes in 0.8.0 — upgrade is additive and low risk.

Key questions

  • Which Symfony versions are supported? Answered by 0.8.0: Symfony 8 is supported (confirm whether 7.x remains in the constraint range so mixed-version services can share a version).
  • Which Doctrine ORM versions are supported, and is ORM 3 / PHP attributes covered? Still unanswered and now the single most important open compatibility question.
  • What is the output format — human-readable console, or machine-parsable (JSON) suitable for CI gating and diffing?
  • Does the command require a live database connection, or can it analyse mapping metadata alone?
  • Does it resolve mappings across multiple bundles, inheritance hierarchies, and embeddables?
  • Is there a configurable rule set / severity levels, or is it a fixed report?
  • What is the maintainer's issue-response history (release cadence now looks healthy; responsiveness to bug reports is unverified)?

Integration Approach

Stack fit

  • Adopt only where Doctrine ORM is the system of record for the affected services. Scope the pilot to a single bounded Symfony/Doctrine service.
  • Do not adopt as a dependency in Eloquent-based Laravel services. Instead, record the analysis dimensions it checks (bidirectional completeness, cascade semantics, orphan removal) as review-checklist items, and consider a small internal Artisan audit command if the estate has recurring relation-hygiene defects.
  • 0.8.0 makes the bundle viable for services on Symfony 8 / PHP 8.4 as well as older supported lines — slightly widening the addressable set of pilot candidates, but not changing the Eloquent verdict.

Migration path

  1. Add as a require-dev dependency in the pilot service with a pinned constraint (choose 0.8.x where PHP ≥ 8.4 is available, otherwise stay on the 0.7.x line and track the gap).
  2. Register the bundle for dev/test environments only.
  3. Run in report-only mode against the full entity graph and capture a baseline of current findings.
  4. Publish the baseline as a known-issues list; do not attempt remediation of legacy findings upfront.
  5. Promote to CI as a non-blocking informational job, then to blocking on new/changed entities only.

Compatibility

  • Verify PHP floor (Symfony 8 requires PHP 8.4), Symfony bundle version range, and Doctrine ORM major version against the pilot service before merge. The ORM check is now the gating one.
  • If the pilot service is on Symfony 7 / PHP 8.2–8.3, confirm 0.8.0's constraint still permits install; if not, use 0.7.x and note the deliberate lag.
  • Confirm the bundle loads in the same kernel/bootstrapping path as the app's Doctrine configuration; bundle registration failures typically surface as "command not found," which is easy to misdiagnose.
  • If CI lacks a database, confirm metadata-only analysis works; otherwise provision a lightweight schema-less container.

Sequencing

  • Phase 1 (week 1): spike + output quality assessment on one service, on the newest supported Symfony/ORM combination the estate actually runs. Go/no-go on signal-to-noise.
  • Phase 2 (week 2): baseline capture, dev-dependency merge, CI informational job.
  • Phase 3 (weeks 3–4): tighten to blocking on delta; document the rule set and suppression mechanism.
  • Phase 4 (optional): evaluate extension to additional Doctrine services; if ≥3 services adopt, assign internal ownership and consider a vendored fork. 0.8.0 slightly lowers the urgency of the fork decision by demonstrating continued upstream maintenance.

Operational Impact

Maintenance

  • Zero production maintenance burden — dev dependency only, no runtime footprint.
  • Upstream maintenance risk is real but bounded, and the 0.8.0 release modestly improves the outlook: the maintainer shipped Symfony 8 support on the framework's release cycle. Keep the review trigger regardless: if the package goes >12 months without a release or fails on a Doctrine major upgrade, fork under the platform team (<1 week for a bundle this size).
  • Pin the version; avoid floating constraints on a low-adoption package. Note the PHP 8.4 implication when pinning across a mixed-runtime estate.

Support

  • Community-only support: no vendor, no SLA, no paid tier. Internal support model is "platform team owns the CI job and the suppression list."
  • Document the command, the baseline exceptions file, the supported PHP/Symfony/Doctrine matrix, and the escalation path (fork or replace) in the team runbook.

Scaling

  • Analysis cost scales with entity count and mapping complexity; expect sub-minute runs under a few hundred entities and possible memory pressure on very large metadata graphs (thousands of entities). Isolate the job so it doesn't slow the main pipeline.
  • Parallelises naturally across services if each runs its own CI job.

Failure modes

  • Noise fatigue: too many legacy findings → team ignores the job. Mitigate with baseline + delta-only gating.
  • Silent disablement: bundle dropped from bundles.php during a Symfony upgrade → job passes vacuously. 0.8.0's Symfony 8 support reduces (but does not eliminate) the chance of a constraint conflict forcing removal during an upgrade. Add an assertion that the command actually executed and produced output.
  • Upstream drift: a future Doctrine major upgrade breaks the analyser. Detect via a canary service on the upgrade branch.
  • Runtime-floor mismatch: Symfony 8 support raises the PHP 8.4 floor; teams on older runtimes silently stuck on 0.7.x may miss future fixes. Track the pinned version per service.
  • Environment coupling: command requiring DB connectivity fails in CI. Confirm and document the requirement.
  • Heuristic blind spots: inheritance and multi-bundle mappings missed, creating false confidence. Treat findings as review input, not authoritative.

Ramp-up

  • Low: one PHP engineer, roughly half a day to learn the command surface and one day to interpret output against the entity model.
  • The real ramp-up cost is domain, not tooling — someone must adjudicate which flagged relations are intentional. Budget a senior Doctrine-fluent engineer for the baseline triage pass.

TPM verdict

  • Unchanged in direction. 0.8.0 is a small, additive compatibility release: it removes the Symfony 8 gap and reinforces the "maintainer is active" signal, but leaves the Doctrine ORM 3 question open and does nothing for Eloquent estates.
  • Still worth a time-boxed spike in any Doctrine-based service with recurring relation-mapping defects; proceed on 0.8.x where PHP 8.4 is available. Not worth pursuing in an Eloquent-only Laravel estate — the correct output there is a documented review checklist, not a dependency.
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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib