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

Phpcs Phar Laravel Package

jin2chen/phpcs-phar

A Composer-installable PHAR distribution of PHP_CodeSniffer (PHPCS), making it easy to run coding-standard checks in local development and CI without managing a separate PHPCS installation.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Architecture fit: PHP_CodeSniffer is a dev-time coding-standard and static-analysis tool, so a Composer-installable PHAR fits a Laravel/PHP project as an isolated require-dev dependency. It keeps PHPCS and its dependencies out of the application dependency graph, reduces version-conflict risk, and preserves the familiar vendor/bin/phpcs and vendor/bin/phpcbf workflow. Existing phpcs.xml rulesets remain usable, which keeps adoption friction low.
  • Integration feasibility: High for standard Composer-based Laravel projects. Installation is a dev dependency, invocation is via vendor binaries, and wiring into Composer scripts, CI, and pre-commit hooks is straightforward. The main prerequisites are a PHP runtime that can execute PHARs, the phar extension available, and no binary-name collision with other linting tools.
  • Technical risk: Medium-to-high. The repository stars belong to upstream squizlabs/PHP_CodeSniffer, not this wrapper, so popularity should not be read as validation of this distribution. 0 dependents and a last release date of 2023-02-22 indicate low independent adoption and staleness. The documented upstream release is 3.6.0, which added PHP 8.0 support but is not sufficient evidence of PHP 8.1/8.2/8.3 support for modern Laravel applications. PHAR provenance, reproducibility, and update cadence are also unclear. The BSD-3-Clause license is acceptable, but the wrapper is not the official upstream distribution.
  • Key questions:
    • Which exact PHP_CodeSniffer version is bundled, and how is the PHAR built, signed, and verified?
    • What PHP and Laravel version matrix is supported in practice?
    • Does it correctly parse PHP 8.1/8.2/8.3 syntax used by current Laravel projects?
    • Can the team pin, mirror, and checksum the PHAR for CI supply-chain control?
    • Does it conflict with global PHPCS, Laravel Pint, or other Composer-installed binaries?
    • Who owns upgrades, and what is the exit path to official squizlabs/php_codesniffer or an official PHAR?
    • Are all required sniffs and custom standards included and compatible?

Integration Approach

  • Stack fit: Use as a tactical linting isolation layer for Laravel repositories that need PHPCS without polluting application dependencies. It fits local development, CI jobs, and pre-commit checks. If the team already uses Laravel Pint, define clear boundaries to avoid duplicate formatting/linting responsibilities; PHPCS is better suited to explicit PSR-12 or custom rulesets, while Pint may remain the default formatter.
  • Migration path: Inventory existing coding standards and tooling first. If a global PHPCS install exists, validate the wrapper’s bundled version before replacing it. Add the package as an exact-pinned require-dev, retain or create phpcs.xml, baseline current violations, add a Composer script, run CI in non-blocking mode, fix or baseline findings, then make the check blocking and add pre-commit enforcement. If modern PHP syntax support is required, migrate to the official Composer package or official PHAR instead of extending the wrapper.
  • Compatibility: Verify the project’s PHP matrix, Laravel versions, CI images, Composer 2 behavior, ext-phar, and binary paths. Confirm that custom sniffs and ruleset references still work. Test on Windows/WSL if developers use those environments, because older PHPCS versions had path-related issues. Avoid floating versions; pin the package and cache Composer downloads in CI.
  • Sequencing: 1) Validate PHAR provenance and bundled PHPCS version. 2) Pilot in one repository. 3) Establish a ruleset and baseline. 4) Add non-blocking CI execution. 5) Fix or suppress findings deliberately. 6) Make CI blocking. 7) Add pre-commit hooks. 8) Document upgrade and exit criteria. Keep an official PHPCS fallback ready before broad rollout.

Operational Impact

  • Maintenance: Day-to-day maintenance is low because the tool is isolated from application dependencies and runs only in development/CI. Stewardship risk is the larger concern: the wrapper is stale, has no dependent ecosystem, and may not track upstream PHPCS releases or security fixes. The TPM should assign an internal owner and schedule periodic review rather than assuming the package will remain current.
  • Support: Support is community-only, with upstream PHPCS documentation applicable but wrapper-specific issues likely unanswered. With zero dependents, there is little external validation or pressure for fixes. An internal runbook covering commands, ruleset customization, suppressions, autofix behavior, and fallback procedures is required.
  • Scaling: The package scales adequately across repositories and CI jobs because it is a single PHAR and does not alter the application dependency graph. Use Composer caching and PHPCS caching for large codebases. Runtime performance should be comparable to normal PHPCS, but CI parallelism and cache strategy still matter at organization scale.
  • Failure modes: Common failures include PHAR execution being disabled or ext-phar missing, Composer package abandonment or unavailability, unsupported modern PHP syntax causing parse errors or false positives, ruleset drift, binary-name collisions, and supply-chain concerns from an unverified PHAR. Stale standards can also create false confidence. Mitigations include exact pinning, internal mirroring/checksums, non-blocking pilot rollout, CI image validation, and a documented fallback to official PHPCS.
  • Ramp-up: Low for developers already familiar with PHPCS; moderate for teams new to rulesets, baselines, and autofix workflows. Onboarding should cover phpcs/phpcbf usage, phpcs.xml ownership, suppression policy, CI gating, and the boundary with Laravel Pint. The TPM should frame this package as a short-term isolation tool with explicit adoption and exit criteria, not as a long-term strategic 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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core