PHPackages                             dcandido/code-sniffer - 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. dcandido/code-sniffer

ActiveLibrary[Testing &amp; Quality](/categories/testing)

dcandido/code-sniffer
=====================

CodeSniffer.

v1.6.0(3y ago)0811[1 PRs](https://github.com/danielcandidocel/code-sniffer/pulls)MIT

Since Aug 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/danielcandidocel/code-sniffer)[ Packagist](https://packagist.org/packages/dcandido/code-sniffer)[ RSS](/packages/dcandido-code-sniffer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (10)Used By (0)

Coding Standard
===============

[](#coding-standard)

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

[](#table-of-contents)

- [Requirements](#requirements)
- [How to install](#how-to-install)
    - [Enabling the rules](#enabling-the-rules)
    - [How to usage](#usage)
    - [Sniffing code in PHPStorm](#sniffing-code-in-phpstorm)

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

[](#requirements)

- [squizlabs/php\_codesniffer](https://github.com/squizlabs/PHP_CodeSniffer) 3.6 or higher

How to install
--------------

[](#how-to-install)

```
composer require dcandido/quality-tools --dev
```

How to use
----------

[](#how-to-use)

### Enabling the rules

[](#enabling-the-rules)

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

```

  The coding standard for Project.

  app
  bootstrap

  bootstrap/cache/*
  tests/Unit/*
  resources
  bootstrap/autoload.php
  */migrations/*
  */seeds/*
  vendor/*
  public/*
  *.js

```

### Usage

[](#usage)

Run Command:

```
./vendor/bin/phpcs
```

If you have errors, you will see the following:

```
$ phpcs

FILE: /path/to/code/file1.php
--------------------------------------------------------------------------------
FOUND 5 ERROR(S) AFFECTING 5 LINE(S)
--------------------------------------------------------------------------------
  2 | ERROR | Missing file doc comment
 20 | ERROR | PHP keywords must be lowercase; expected "false" but found "FALSE"
 47 | ERROR | Line not indented correctly; expected 4 spaces but found 1
 51 | ERROR | Missing function doc comment
 88 | ERROR | Line not indented correctly; expected 9 spaces but found 6
--------------------------------------------------------------------------------

FILE: /path/to/code/file2.php
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 21 | ERROR   | PHP keywords must be lowercase; expected "false" but found
    |         | "FALSE"
 21 | WARNING | Equals sign not aligned with surrounding assignments
--------------------------------------------------------------------------------
```

You can run phpcbf to fix the errors automatically:

```
./vendor/bin/phpcbf
```

```
PHPCBF RESULT SUMMARY
----------------------------------------------------------------------
FILE                                                  FIXED  REMAINING
----------------------------------------------------------------------
.../path/to/code/file.php                               7      0
.../path/to/code/file2.php                              5      0
```

### 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.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~0 days

Total

9

Last Release

1355d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/559d30d7adcd867c2be31020455d032a2a089d160a795e6b207be3f0c5f51de3?d=identicon)[danielcandidocel](/maintainers/danielcandidocel)

---

Top Contributors

[![danielcandidocel](https://avatars.githubusercontent.com/u/31665042?v=4)](https://github.com/danielcandidocel "danielcandidocel (18 commits)")

### Embed Badge

![Health badge](/badges/dcandido-code-sniffer/health.svg)

```
[![Health](https://phpackages.com/badges/dcandido-code-sniffer/health.svg)](https://phpackages.com/packages/dcandido-code-sniffer)
```

###  Alternatives

[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k123.5M1.8k](/packages/slevomat-coding-standard)[magento/magento-coding-standard

A set of Magento specific PHP CodeSniffer rules.

37113.4M299](/packages/magento-magento-coding-standard)[youwe/testing-suite

Contains Youwe's default testing packages for php.

13176.9k8](/packages/youwe-testing-suite)

PHPackages © 2026

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