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

Technical Evaluation

Architecture fit: The package remains a PHPCS sniff, maintaining perfect alignment with Laravel’s static analysis tooling (e.g., laravel/pint, squizlabs/php_codesniffer). It operates as a standalone linting layer without architectural disruption, though its compatibility with newer PHPCS versions is now explicitly confirmed as broken (see Technical risk).

Integration feasibility: Still high for basic use, but critical caveats remain:

  • The unknown repository and lack of Packagist registration persist, blocking reliable dependency management.
  • The new static analysis Composer keyword suggests minimal effort to discover the package, but no official Packagist entry means manual installation is still required.
  • PHP 8.2 support is added, but PHPCS version constraints remain unresolved (still incompatible with newer PHPCS releases per #52).

Technical risk: Critical (unchanged, but now with explicit confirmation of limitations):

  • Legal: "NOASSERTION" license remains a commercial-use blocker.
  • Maintenance: Last release (April 2023) + unresolved PHPCS compatibility (#52) signal abandonment risk.
  • Security: No audit path due to unknown repository.
  • Compatibility: PHP 8.2 support is a partial win, but PHPCS versioning is a showstopper for modern Laravel stacks (PHPCS 4.x+).

Key questions:

  • What is the exact GitHub repository URL? (Still unknown; critical for auditing.)
  • Is the package registered on Packagist? (No; blocks CI/CD integration.)
  • Does it support PHPCS 4.x? (No; explicitly broken per #52.)
  • Are there security vulnerabilities? (Unverifiable without repository access.)
  • Is there a migration path for PHPCS upgrades? (None indicated.)

Integration Approach

Stack fit: Native to Laravel’s PHPCS ecosystem, but now explicitly incompatible with modern PHPCS versions (4.x+). Works alongside laravel/pint or phpcs CLI, but only if PHPCS ≤3.x is enforced—a non-starter for most Laravel 10+ projects (which default to PHPCS 4.x).

Migration path:

  1. Short-term: Use only if PHPCS 3.x is manually pinned (e.g., via composer require phpcs/phpcs:^3.7).
    • Add to phpcs.xml ruleset:
      <rule ref="Vendor\SniffName"/>
      
    • Risk: Breaks on PHPCS upgrades.
  2. Long-term: Abandon unless:
    • The package is forked/maintained to support PHPCS 4.x.
    • A replacement sniff (e.g., from squizlabs/php_codesniffer or community) is identified.

Compatibility:

  • PHP 8.2: ✅ Supported (fixes #55).
  • PHPCS 4.x: ❌ Broken (per #52; no ETA for fix).
  • Laravel 10+: ❌ Incompatible (defaults to PHPCS 4.x).

Sequencing:

  1. Audit: Confirm PHPCS version in project (phpcs --version).
  2. Decision: Proceed only if PHPCS ≤3.x is acceptable.
  3. Integration: Add to composer.json (manual) and phpcs.xml.
  4. Testing: Validate against PHP 8.2 codebase.

Operational Impact

Maintenance:

  • High effort: Manual dependency management (no Packagist) and PHPCS version pinning required.
  • Upgrade risk: PHPCS upgrades will break the sniff until #52 is resolved.

Support:

  • Community: Minimal (32 stars, no recent activity).
  • Vendor: No official support; issues may go unaddressed.

Scaling:

  • No impact if used in PHPCS ≤3.x environments.
  • Blocker for teams using PHPCS 4.x or auto-upgrading CI pipelines.

Failure modes:

  1. PHPCS upgrade: Sniff fails silently or throws errors.
  2. PHP 8.3+: Untested (last PHP fix was for 8.2).
  3. Dependency conflicts: Unknown repository risks Composer instability.

Ramp-up:

  • For adopters: Steep learning curve due to manual setup and PHPCS versioning constraints.
  • For maintainers: Not recommended unless PHPCS compatibility is resolved. Prioritize alternatives like:
    • Custom PHPCS sniffs.
    • Community-maintained forks.
    • Replacement packages (e.g., phpstan/phpstan).
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.
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
anil/file-picker
broqit/fields-ai