PHPackages                             fossbarrow/laravel-phpcs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. fossbarrow/laravel-phpcs

ActivePhpcs-ruleset[Testing &amp; Quality](/categories/testing)

fossbarrow/laravel-phpcs
========================

phpcs ruleset for laravel projects

40293.6k↓14.8%25[1 PRs](https://github.com/PatricNox/laravel-phpcs/pulls)

Since Sep 5Pushed 2y ago2 watchersCompare

[ Source](https://github.com/PatricNox/laravel-phpcs)[ Packagist](https://packagist.org/packages/fossbarrow/laravel-phpcs)[ RSS](/packages/fossbarrow-laravel-phpcs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP CodeSniffer rules for Laravel coding style (PSR-2 variant)
==============================================================

[](#php-codesniffer-rules-for-laravel-coding-style-psr-2-variant)

[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![PR friendly repository](https://camo.githubusercontent.com/04d9817f9ae2ecc8bd798c1d4874835046ec190e89d2f4b84245e639c38ccbb1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50756c6c2d2d526571756573742d61726525323077656c636f6d65212d666636396234)](/compare)[![Follow Fossbarrow on Twitter](https://camo.githubusercontent.com/f754df998ca95b7040221cde5a57bd48191f3f290c45f7a54b932ea593625b82/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f666f7373626172726f773f7374796c653d736f6369616c)](https://camo.githubusercontent.com/f754df998ca95b7040221cde5a57bd48191f3f290c45f7a54b932ea593625b82/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f666f7373626172726f773f7374796c653d736f6369616c)

> Authored by fossbarrow IO

[php codesniffer ruleset](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset) for laravel projects.

Requirements
------------

[](#requirements)

- [https://github.com/squizlabs/PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)

Table of contents
-----------------

[](#table-of-contents)

- [How to install](#install)
    - [Enabling the rules](#enabling-the-rules)
    - [Sniffing code](#sniffing-code)
    - [Sniffing code in PHPStorm](#sniffing-code-in-phpstorm)
- [License](#license)
- [Contributing](#contributing)
- [Credits](#credits)

Installation
------------

[](#installation)

Install the ruleset by

1. Copy the `phpcs.xml` file into your project root with phpcs installed.

Usage
-----

[](#usage)

### Enabling the rules

[](#enabling-the-rules)

> Only neccesary if you installed as a package using composer!

Add it to your project `phpcs.xml` or `phpcs.xml.dist` ruleset:

```

    ./app
    ./config
    ./resources
    ./routes
    ./tests

```

### Sniffing code

[](#sniffing-code)

Use php CodeSniffer commands, pointed towards your xml file, to sniff the code using the new ruleset.

> vendor/bin/phpcs vendor/bin/phpcbf

#### Sniffing code in PHPStorm

[](#sniffing-code-in-phpstorm)

See [PHP Code Sniffer in PhpStorm](https://confluence.jetbrains.com/display/PhpStorm/PHP+Code+Sniffer+in+PhpStorm) on how to set up CodeSniffer in PHPStorm.

---

Contributing
------------

[](#contributing)

All changes that makes the sniffer more accurate towards *Laravel*'s coding standard is always highly appreciated and welcome.

Please see [CONTRIBUTING](docs/CONTRIBUTING.md) for more details.

Credits
-------

[](#credits)

- [PatricNox](https://github.com/PatricNox)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c5828cb6d781ff056894f9643d5691587c8ba70d84232646f722f1891b4955b?d=identicon)[PatricNox](/maintainers/PatricNox)

---

Top Contributors

[![PatricNox](https://avatars.githubusercontent.com/u/31646653?v=4)](https://github.com/PatricNox "PatricNox (15 commits)")[![ChaerilM](https://avatars.githubusercontent.com/u/1352081?v=4)](https://github.com/ChaerilM "ChaerilM (1 commits)")[![ehsanrasta](https://avatars.githubusercontent.com/u/35690824?v=4)](https://github.com/ehsanrasta "ehsanrasta (1 commits)")[![fey](https://avatars.githubusercontent.com/u/697178?v=4)](https://github.com/fey "fey (1 commits)")[![hypebeans](https://avatars.githubusercontent.com/u/24372255?v=4)](https://github.com/hypebeans "hypebeans (1 commits)")

---

Tags

hacktoberfesthacktoberfest2022laravel-rulesetlaravel-standardphp-codesnifferphpcs-laravelphpcs-standardruleset

### Embed Badge

![Health badge](/badges/fossbarrow-laravel-phpcs/health.svg)

```
[![Health](https://phpackages.com/badges/fossbarrow-laravel-phpcs/health.svg)](https://phpackages.com/packages/fossbarrow-laravel-phpcs)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
