Weave Code
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

Php Coupling Detector Laravel Package

akeneo/php-coupling-detector

Detect PHP coupling issues based on configurable rules by analyzing class use statements. Supports forbidden, discouraged, and only rules, with error/warning violations. Includes commands to detect violations and list unused requirements.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Code Quality & Maintainability: Enables proactive identification of architectural debt (e.g., circular dependencies, excessive coupling) before it impacts development velocity or scalability. Aligns with initiatives to reduce technical debt and improve long-term maintainability, now with PHP 8.2 and Symfony 7 compatibility ensuring seamless integration into modern Laravel ecosystems.
  • Developer Experience (DX): Reduces cognitive load for engineers by surfacing coupling violations early (e.g., during PR reviews or CI/CD pipelines), enabling faster onboarding and fewer merge conflicts. The updated compatibility ensures no disruption for teams adopting newer PHP/Symfony versions.
  • Scalability & Refactoring: Provides data-driven insights to justify refactoring efforts (e.g., splitting monolithic services, decoupling microservices) by quantifying coupling risks. The PHP 8.2/Symfony 7 support broadens adoption for teams migrating to these stacks.
  • Build vs. Buy: Justifies building a custom coupling analyzer only if the package’s predefined rules don’t cover domain-specific constraints (e.g., legacy system constraints or custom architecture patterns). The active maintenance (new contributors, compatibility fixes) reduces risk of forking or abandoning the package.
  • Roadmap Prioritization: Helps prioritize technical work by flagging high-impact coupling issues (e.g., "Module X depends on 12 other modules") that block feature delivery or scaling. The stability improvements make it a safer bet for long-term integration.

When to Consider This Package

Adopt if:

  • Your PHP/Laravel codebase is growing in complexity (e.g., >50K LOC, multiple teams, or frequent merge conflicts).
  • You lack static analysis tools (e.g., PHPStan, Psalm) that cover coupling-specific rules or need custom coupling policies (e.g., "No module may depend on the database layer").
  • You’re migrating to microservices or modular monoliths and need to audit existing dependencies.
  • Your team prioritizes proactive code health over reactive fixes (e.g., "Why did this refactor break 3 other services?").
  • You’re using Laravel’s service container heavily and suspect hidden dependencies (e.g., singleton services leaking across modules).
  • Your stack includes PHP 8.2 or Symfony 7, ensuring seamless integration without compatibility issues.
  • You want a maintained, actively developed tool (evidenced by recent contributions and compatibility fixes).

Look elsewhere if:

  • Your project is small or greenfield (coupling risks are minimal; focus on testing/design patterns instead).
  • You need real-time IDE feedback (consider PHPStan/Psalm extensions with coupling rules).
  • Your coupling rules are highly domain-specific (e.g., financial systems with regulatory constraints) and require custom tooling.
  • You’re already using a dedicated architecture tool (e.g., Structurizr, ArchUnit) that overlaps with this package’s scope.
  • Your team lacks time to integrate a new tool into CI/CD pipelines or developer workflows.
  • You’re not using PHP 8.2 or Symfony 7 and prefer avoiding potential future compatibility workarounds.

How to Pitch It (Stakeholders)

For Executives: "This tool is like a ‘code CT scan’ for our PHP/Laravel applications—now fully compatible with PHP 8.2 and Symfony 7, ensuring it works flawlessly with our modern stack. It automatically detects hidden dependencies that slow down development, increase bugs, and make scaling harder. For example, it could reveal that a critical feature depends on 5 other modules, explaining why refactoring takes weeks. With active maintenance and new contributors, this is a low-risk, high-impact way to future-proof our tech stack, reducing rework and accelerating releases while saving time and money long-term."

For Engineering Leaders: *"The akeneo/php-coupling-detector (v0.8.3) now supports PHP 8.2 and Symfony 7, making it a safer choice for teams upgrading their stacks. Key benefits include:

  • CI/CD Integration: Fail builds if coupling rules are violated (e.g., ‘No module should depend on the legacy auth system’), with no compatibility roadblocks.
  • Data-Driven Decisions: Quantify coupling risks to prioritize refactoring (e.g., ‘Module Y is a bottleneck—let’s decouple it’).
  • Developer Empowerment: Engineers get clear feedback during PRs (e.g., ‘This change adds a circular dependency with Module Z’).
  • Laravel-Specific: Works with the service container, event system, and common patterns like repositories/services. We can start with default rules, then customize for our architecture (e.g., domain-driven design boundaries). The recent fixes and new contributors signal strong ongoing support—ideal for long-term adoption."

For Developers: *"Imagine if your IDE warned you every time you created a dependency that could break another team’s work—but now, it’s fully compatible with PHP 8.2 and Symfony 7, so no more ‘works on my machine’ excuses due to version mismatches. This tool does that for the whole codebase:

  • No more merge hell: Catches hidden dependencies before they cause conflicts, especially in modern Laravel apps.
  • Faster onboarding: See the ‘big picture’ of how modules interact without compatibility headaches.
  • Less fear of refactoring: Know exactly what changes are safe (or risky) before touching code. We can tweak the rules to match how we structure Laravel apps (e.g., ignore certain service container bindings). It’s experimental but could save us hours of debugging—and now it won’t break when we upgrade PHP!"
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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui