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
Php Coding Standard

Php Coding Standard Laravel Package

swivl/php-coding-standard

A Composer-installable PHP_CodeSniffer ruleset from Swivl for enforcing consistent coding style across PHP projects. Includes configuration and sniffs to catch style issues, with support for automated fixes via PHPCBF and easy integration into CI pipelines.

Deep Wiki
Context7

Swivl Coding Standard for PHP_CodeSniffer

Frequently asked questions about Php Coding Standard
How do I install swivl/php-coding-standard with Composer?
Install it as a development dependency with Composer using composer require --dev swivl/php-coding-standard. Then reference the installed ruleset in your phpcs.xml or pass it directly to PHP_CodeSniffer. It is a standard phpcs ruleset, so no Laravel-specific setup is required.
Can I use swivl/php-coding-standard in a Laravel project?
Yes. It is a PHP_CodeSniffer ruleset that works in any PHP codebase, including Laravel applications. Add it to your project's phpcs configuration and run phpcs against your app, routes, tests, and other PHP directories. It does not replace Laravel-specific tooling such as Pint, but it can complement it.
How do I run the coding standard on my codebase?
After installing the package, configure it as a ruleset in phpcs.xml or invoke phpcs with the ruleset path. Run the phpcs command against the directories you want checked. Violations are reported in the console and can be used locally or in CI.
Does swivl/php-coding-standard work with phpcbf for automatic fixes?
Yes. Because it is a PHP_CodeSniffer ruleset, violations from fixable sniffs can be corrected with phpcbf. Run phpcbf against the same files and ruleset you use with phpcs. Review the changes afterward, since automated fixes should still be checked before committing.
How do I integrate this ruleset into a CI pipeline?
Install the package in your CI environment and run phpcs as part of your build or test job. Configure phpcs to exit with a non-zero status when violations are found so the pipeline fails. This catches style issues before they reach code review.
Can I customize or override the Swivl coding standard rules?
Yes. The package provides a base ruleset that you can extend or override in your project's own phpcs.xml. You can exclude specific sniffs, adjust properties, or add rules for project-specific conventions. This keeps the shared standard as a starting point while allowing local flexibility.
Which PHP versions does swivl/php-coding-standard support?
PHP version support depends on the package's Composer constraints and its PHP_CodeSniffer dependency. Check the composer.json requirements before installing in projects running older PHP versions. In general, use a PHP version supported by both PHP_CodeSniffer and your application.
Is swivl/php-coding-standard PSR-compliant?
The package describes itself as bundling PSR-aligned conventions in one place. It is intended to enforce a consistent style across Swivl PHP projects rather than define a new standard from scratch. Review the included ruleset to confirm it matches the specific PSR rules your team expects.
How is this different from Laravel Pint or other coding standards?
Laravel Pint is a Laravel-focused fixer built on PHP-CS-Fixer, while swivl/php-coding-standard is a PHP_CodeSniffer ruleset installed via Composer. It focuses on enforcing Swivl's shared conventions and can be used with phpcs and phpcbf in CI. Choose based on whether your team prefers PHP_CodeSniffer workflows or Pint's defaults.
Is swivl/php-coding-standard actively maintained and safe for production projects?
The package is distributed as a Composer-installable development dependency, so it does not affect production runtime code. Before adopting it, check the repository's release history and Composer constraints for compatibility with your PHP and PHP_CodeSniffer versions. Pin a version in CI for reproducible style checks.
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