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

Coding Standard Laravel Package

keboola/coding-standard

Keboola Coding Standard provides PHP_CodeSniffer rules and sniffs for enforcing consistent code style across Keboola PHP projects. It bundles customizable rule sets that help teams catch style issues early and keep codebases clean, readable, and maintainable.

View on GitHub
Deep Wiki
Context7

keboola/coding-standard is a PHP_CodeSniffer ruleset that enforces the shared coding conventions used across Keboola's PHP projects. It bundles a curated set of sniffs—built largely on slevomat/coding-standard—so teams get consistent formatting, strict typing, and defensive coding rules with a single dependency instead of hand-maintaining their own ruleset.

  • One-command adoption via composer require --dev keboola/coding-standard
  • Opinionated defaults for type hints, strict comparisons, and trailing commas
  • Promotes early returns, declare(strict_types=1), and clean namespace usage
  • Works with standard phpcs / phpcbf workflows and CI pipelines
  • Easy to extend by referencing its ruleset.xml from your project config
Frequently asked questions about Coding Standard
What is keboola/coding-standard and how does it work with Laravel?
It is a PHP_CodeSniffer ruleset, shipped as a ruleset.xml plus a Composer manifest, that layers Keboola's conventions on top of PSR-12 and Slevomat. It works entirely at the tooling layer, so it never touches Laravel's autoloading, service providers, or runtime behavior. In a Laravel app you add it as a dev dependency and reference the Keboola standard from phpcs.xml.dist. Nothing about it is Laravel-specific, which is exactly why it slots in without architectural changes.
How do I install keboola/coding-standard in a Laravel project?
Run composer require --dev keboola/coding-standard together with dealerdirect/phpcodesniffer-composer-installer so the standard is registered automatically, then add a phpcs.xml.dist containing a rule reference to Keboola and run vendor/bin/phpcs. Before committing, check transitive constraints with composer why-not keboola/coding-standard against your existing dev dependencies. A single module is enough to validate the setup in an afternoon.
Which PHP and PHPCS versions does keboola/coding-standard support?
The ruleset inherits requirements from PSR-12 and Slevomat, and the assessment places it as compatible with PHP 8.1+ and Laravel 10/11. The exact PHPCS major version it targets (3.x versus 4.x) should be confirmed from the package's composer.json before adoption, because a mismatch with your squizlabs/php_codesniffer constraint is the most likely install failure. Use composer why-not to surface the conflict early rather than discovering it in CI.
How does keboola/coding-standard differ from PSR-12 and Laravel Pint?
It builds on PSR-12 rather than replacing it, adding Keboola opinions on things like strict types, import ordering, trailing commas, and indentation. Pint is a different engine entirely, PHP-CS-Fixer under the hood, so its defaults will not match sniff-for-sniff. The size of your initial reformat diff depends on how far those opinions diverge from your current Pint configuration, so run a full phpcs report on app/ first and quantify violations per sniff.
Can I use keboola/coding-standard alongside Laravel Pint?
Technically yes, but running both engines produces rule drift and contradictory auto-fixes, which is worse than either alone. Pick one source of truth: either use the Keboola PHPCS standard for enforcement and restrict Pint to formatting only, or skip this package and encode equivalent rules in pint.json. Mixing them without an explicit owner for each rule category is the most common way this integration goes wrong.
How do I exclude legacy code or create a baseline with keboola/coding-standard?
The ruleset does not clearly ship a baseline mechanism, so plan on phpcs-baseline or a hand-maintained exclude list in phpcs.xml.dist. Migrate in sequence: run against app/ only, quantify violations by sniff to find the expensive rules, baseline the legacy files, reformat per-directory in isolated PRs, then expand scope to tests/ and database/. Avoid a big-bang reformat, which makes review impossible and hides real regressions.
Does keboola/coding-standard work as a CI quality gate for Laravel apps?
Yes. PHPCS exits non-zero on violations, so it drops straight into a CI job. Roll it out as a sandbox validation, then a non-blocking job, then a baseline commit, then a blocking gate on changed files only, and finally a full-repo gate. Keep in mind PHPCS is single-threaded by default, so on a large Laravel monorepo scope each run or parallelize it.
Is keboola/coding-standard safe to use in production?
It never reaches production, since it is a dev-only ruleset with no runtime footprint. The real risk sits at the governance layer: the package has roughly one star and zero dependents, which suggests it is maintained mainly for Keboola's own repositories. Mitigate cheaply by pinning exact versions and being ready to vendor or fork the MIT-licensed ruleset if upstream goes quiet.
How do I resolve conflicts between keboola/coding-standard and other dev dependencies?
Slevomat versions pinned by the standard are the most likely conflict point against other dev dependencies in a Laravel project. Run composer why-not keboola/coding-standard to identify the blocking constraint, confirm the Composer installer plugin registers the standard correctly, and verify CI images have the tokenizer and xml PHP extensions. If a pin cannot be reconciled, fork the ruleset and relax that sniff version rather than dropping the whole standard.
Is keboola/coding-standard actively maintained, and what are the alternatives?
A recent release suggests active internal use, but community signals are thin, and the bus factor is effectively one organization. Assign a named internal owner, review upstream quarterly, and document the fork procedure in CONTRIBUTING.md. If that overhead is unacceptable, the alternatives are Laravel Pint, plain PSR-12, or assembling Slevomat sniffs yourself. Because the ruleset is MIT-licensed and mostly declarative XML, forking costs hours rather than weeks.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections