- What is jin2chen/phpcs-phar and what binaries does it provide?
- jin2chen/phpcs-phar packages PHP_CodeSniffer as a self-contained PHAR and exposes phpcs and phpcbf through Composer. It is intended for dev-time coding-standard checks, not application runtime code. The repository points to squizlabs/PHP_CodeSniffer, but this package is a wrapper distribution rather than the official upstream package.
- How do I install jin2chen/phpcs-phar in a Laravel project?
- Install it as a dev dependency with composer require --dev jin2chen/phpcs-phar, preferably pinned to an exact version. Your PHP runtime must be able to execute PHARs and ext-phar should be available. Then call vendor/bin/phpcs or vendor/bin/phpcbf from project scripts or CI.
- Which PHP_CodeSniffer version is bundled in this PHAR?
- The technical assessment documents upstream PHP_CodeSniffer 3.6.0 as the referenced release, but the wrapper does not make provenance or build details obvious. Verify the exact bundled version from the package contents or release metadata before adopting it. Do not assume newer PHPCS 3.x releases are included.
- Does jin2chen/phpcs-phar support PHP 8.1, 8.2, and 8.3 for modern Laravel apps?
- Not clearly. The documented 3.6.0 release added PHP 8.0 support, but that is not evidence of full PHP 8.1, 8.2, or 8.3 parsing support. Current Laravel codebases often use newer syntax, so test against your PHP matrix. If you need modern syntax support, use the official PHP_CodeSniffer Composer package or official PHAR.
- How do I run phpcs and phpcbf using this Composer package?
- Use vendor/bin/phpcs to detect violations and vendor/bin/phpcbf to auto-fix fixable issues. Point them at your ruleset, typically phpcs.xml, and run them through Composer scripts or CI commands. Avoid relying on a global phpcs binary so the bundled version is used.
- Can I use my existing phpcs.xml ruleset and custom PHPCS standards?
- Yes, the package is described as supporting standard PHP_CodeSniffer rulesets and custom standards, and existing phpcs.xml rulesets should remain usable. You still need to verify that any custom sniffs, referenced standards, and path configurations work with the bundled PHPCS version. Test on a sample Laravel repository before replacing an existing PHPCS setup.
- Can I use jin2chen/phpcs-phar in CI and pre-commit hooks?
- Yes, it fits CI jobs and pre-commit hooks because Composer exposes vendor/bin/phpcs and vendor/bin/phpcbf. Start with a non-blocking CI step, baseline existing violations, then make the check blocking. Cache Composer downloads and pin the package for repeatable CI runs.
- Is jin2chen/phpcs-phar safe for production or supply-chain-sensitive CI?
- Treat it as a dev and CI supply-chain risk, not an application runtime risk. The wrapper is not official upstream, has 0 dependents and a last release date of 2023-02-22, and PHAR provenance, reproducibility, signing, and update cadence are unclear. Pin an exact version, mirror and checksum the PHAR for CI, and keep an official PHPCS fallback ready.
- How does it compare with official squizlabs/php_codesniffer or Laravel Pint?
- jin2chen/phpcs-phar is a third-party PHAR wrapper around PHP_CodeSniffer; squizlabs/php_codesniffer is the official Composer package and the safer default for current PHP support. Laravel Pint is a formatter, while PHPCS is better for explicit PSR-12 or custom rulesets and reporting. Define boundaries so Pint and PHPCS do not duplicate formatting work, and keep the official package as your exit path.
- Who maintains jin2chen/phpcs-phar and how do I plan upgrades or an exit path?
- The package appears to be a low-adoption wrapper with a last release date of 2023-02-22, so your team owns upgrade decisions. Pin it, document the bundled version, and set exit criteria before broad rollout. Keep the official squizlabs/php_codesniffer package or official PHAR ready as a fallback.