ahmed-bhs/doctrine-doctor
Doctrine Doctor is a runtime analysis tool for Doctrine ORM that plugs into the Symfony Web Profiler. It ships 90+ analyzers to catch N+1 queries, missing indexes, slow queries, injection risks, and other performance, security, and integrity issues.
bundles.php + YAML).--dev install), ensuring no production impact. Disabling in production is explicit and safe.profiling_collect_backtrace: true in Doctrine DBAL for precise code location tracking. This is optional but highly recommended for debugging.AI Mate and recipe components that were not present in the v2.7.3 assessment. These appear to be additive features, but their scope, telemetry/network behavior, and configuration impact need to be validated before rollout.EXPLAIN permissions. Teams using restricted DB roles may need adjustments.n_plus_one.threshold) may need tuning. Teams should:
AI Mate and recipe components do? Do they involve outbound network calls, telemetry, or API keys that need security/compliance review?--no-dev Composer installs.slow_query with high thresholds).doctrine_doctor.yaml (e.g., lower n_plus_one.threshold to 3).profiling_collect_backtrace: true) for debugging.AI Mate / recipe features pending security review.php bin/console doctrine:doctor:check --severity=critical || exit 1
--no-dev.doctrine_doctor.yaml:
enabled: "%kernel.debug%" # Only in dev
@DoctrineDoctor\Ignore annotations for known-safe patterns.findAll() without limits). Plan for incremental fixes.DoctrineDoctorEvents).// src/DoctrineDoctor/Custom/NPlusOneForOrders.php
use AhmedBhs\DoctrineDoctor\Analyzer\AnalyzerInterface;
class NPlusOneForOrders implements AnalyzerInterface {
public function analyze(): array {
return [/* custom logic */];
}
}
slow_query or missing_index may scale with query complexity.| Failure Mode | Impact | Mitigation |
|---|---|---|
| False positives flood Profiler | Developer fatigue | Tune thresholds; ignore known issues. |
| High CI/CD overhead | Slower feedback loop | Run selectively (e.g., only on changed files). |
| Missing index analyzer fails | No suggestions for performance | Ensure DB user has EXPLAIN permissions; test in staging. |
| Non-blocking analysis misses issues on short-lived requests | Silent gaps in coverage | Run periodic full-request analysis in CI on representative workloads. |
| AI Mate / recipe behavior change (unreviewed) | Unexpected network calls, payload, or cost | Security/compliance review before enabling; pin version and disable if needed. |
| Silent regressions after minor bump (v2.7.3 → v2.11.2) | Unexpected analyzer behavior | Review intermediate changelog; stage rollout; keep prior tag pinned for rollback. |
How can I help you explore Laravel packages today?