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

Phpcs Import Detection Laravel Package

sirbrillig/phpcs-import-detection

PHPCS sniffs that warn when classes/functions/constants are used without an explicit import or fully-qualified name, and flags unused imports. Helps catch namespace issues during refactors (note: PHP 8 tokenization bug/performance caveats).

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Automated import hygiene enforcement: Integrates seamlessly with CI/CD pipelines to enforce consistent import standards, reducing technical debt and manual review overhead.
  • Build vs. buy decision: Eliminates the need to develop custom PHPCS sniffs for import-related issues, accelerating development velocity.
  • Developer experience (DX) focus: Proactively prevents collaboration friction by enforcing clean imports, improving onboarding and maintainability.
  • Scalability for PHP teams: Ideal for growing codebases where inconsistent imports introduce debugging overhead and slow down development.
  • Static analysis alignment: New "static analysis" Composer keyword (#56) strengthens compatibility with modern tooling ecosystems (e.g., IDEs, linters, and static analysis suites), making it easier to integrate with broader code quality workflows.

When to Consider This Package

  • Adopt when:
    • Using PHP_CodeSniffer (v2.x or earlier) and needing import hygiene enforcement (unused/duplicate imports, consistency).
    • Experiencing collaboration friction due to inconsistent imports in PHP projects.
    • Seeking a low-effort, maintainable solution over custom rule development.
    • Prioritizing static analysis in CI/CD pipelines (e.g., alongside tools like Psalm, PHPStan, or IDE integrations).
  • Avoid when:
    • Using PHPCS v3.x+ (due to unresolved compatibility issue #52).
    • Requiring PHP 8.3+ support (deprecated embedded variables fix only addresses PHP 8.2).
    • Needing active maintenance (package appears low-activity; evaluate long-term viability).

How to Pitch It (Stakeholders)

For Executives: "This package automates import hygiene in PHP projects, reducing manual code reviews and technical debt. It integrates with our existing CI/CD pipelines with minimal effort, improving developer productivity and code consistency. The new static analysis keyword (#56) aligns with modern tooling, making it a scalable solution for growing teams. However, note its limited PHPCS v3.x support—we’ll need to validate compatibility before adoption."

For Engineering: "A lightweight PHPCS sniff to enforce clean imports (no unused/duplicates). Works with PHP 8.2 but not PHPCS v3.x (blocker for some teams). The static analysis tag (#56) helps with IDE/linter integration. Low maintenance overhead—ideal for teams already using PHPCS. Tradeoff: If we upgrade PHPCS later, this may need replacement."

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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope