PHPackages                             jacricelli/php\_codesniffer - 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. jacricelli/php\_codesniffer

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

jacricelli/php\_codesniffer
===========================

PHP\_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.

1.5.7(7y ago)0311BSD-3-ClausePHPPHP &gt;=5.1.2

Since Apr 10Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jacricelli/PHP_CodeSniffer)[ Packagist](https://packagist.org/packages/jacricelli/php_codesniffer)[ Docs](http://www.squizlabs.com/php-codesniffer)[ RSS](/packages/jacricelli-php-codesniffer/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (1)

About
-----

[](#about)

PHP\_CodeSniffer is a set of two PHP scripts; the main `phpcs` script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard violations. PHP\_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.

[![Build Status](https://camo.githubusercontent.com/0311abea186c2d0a9ed18b4d855cb1f08e2586a7676ec170eb69938097ce9567/68747470733a2f2f7472617669732d63692e6f72672f737175697a6c6162732f5048505f436f6465536e69666665722e7376673f6272616e63683d70687063732d6669786572)](https://travis-ci.org/squizlabs/PHP_CodeSniffer) [![Code consistency](https://camo.githubusercontent.com/c753ca80744879d6e7c9519f676b875f57ebce0186b2fd94fe25ff2fb94ec2ee/687474703a2f2f737175697a6c6162732e6769746875622e696f2f5048505f436f6465536e69666665722f616e616c797369732f737175697a6c6162732f5048505f436f6465536e69666665722f67726164652e737667)](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer) [![Join the chat at https://gitter.im/squizlabs/PHP_CodeSniffer](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/squizlabs/PHP_CodeSniffer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

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

[](#requirements)

PHP\_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements.

If you're using PHP\_CodeSniffer as part of a team, or you're running it on a [CI](https://en.wikipedia.org/wiki/Continuous_integration) server, you may want to configure your project's settings [using a configuration file](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file).

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

[](#installation)

The easiest way to get started with PHP\_CodeSniffer is to download the Phar files for each of the commands:

```
# Download using curl
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar

# Or download using wget
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar

# Then test the downloaded PHARs
php phpcs.phar -h
php phpcbf.phar -h

```

### Composer

[](#composer)

If you use Composer, you can install PHP\_CodeSniffer system-wide with the following command:

```
composer global require "squizlabs/php_codesniffer=*"

```

Make sure you have the composer bin dir in your PATH. The default value is `~/.composer/vendor/bin/`, but you can check the value that you need to use by running `composer global config bin-dir --absolute`.

Or alternatively, include a dependency for `squizlabs/php_codesniffer` in your `composer.json` file. For example:

```
{
    "require-dev": {
        "squizlabs/php_codesniffer": "3.*"
    }
}
```

You will then be able to run PHP\_CodeSniffer from the vendor bin directory:

```
./vendor/bin/phpcs -h
./vendor/bin/phpcbf -h

```

### Phive

[](#phive)

If you use Phive, you can install PHP\_CodeSniffer as a project tool using the following commands:

```
phive install phpcs
phive install phpcbf

```

You will then be able to run PHP\_CodeSniffer from the tools directory:

```
./tools/phpcs -h
./tools/phpcbf -h

```

### PEAR

[](#pear)

If you use PEAR, you can install PHP\_CodeSniffer using the PEAR installer. This will make the `phpcs` and `phpcbf` commands immediately available for use. To install PHP\_CodeSniffer using the PEAR installer, first ensure you have [installed PEAR](http://pear.php.net/manual/en/installation.getting.php) and then run the following command:

```
pear install PHP_CodeSniffer

```

### Git Clone

[](#git-clone)

You can also download the PHP\_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone:

```
git clone https://github.com/squizlabs/PHP_CodeSniffer.git
cd PHP_CodeSniffer
php bin/phpcs -h
php bin/phpcbf -h

```

Documentation
-------------

[](#documentation)

The documentation for PHP\_CodeSniffer is available on the [Github wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki).

Issues
------

[](#issues)

Bug reports and feature requests can be submitted on the [Github Issue Tracker](https://github.com/squizlabs/PHP_CodeSniffer/issues).

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

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md) for information.

Versioning
----------

[](#versioning)

PHP\_CodeSniffer uses a `MAJOR.MINOR.PATCH` version number format.

The `MAJOR` version is incremented when:

- backwards-incompatible changes are made to how the `phpcs` or `phpcbf` commands are used, or
- backwards-incompatible changes are made to the `ruleset.xml` format, or
- backwards-incompatible changes are made to the API used by sniff developers, or
- custom PHP\_CodeSniffer token types are removed

The `MINOR` version is incremented when:

- new backwards-compatible features are added to the `phpcs` and `phpcbf` commands, or
- backwards-compatible changes are made to the `ruleset.xml` format, or
- backwards-compatible changes are made to the API used by sniff developers, or
- new sniffs are added to an included standard

> NOTE: Backwards-compatible changes to the API used by sniff developers will allow an existing sniff to continue running without producing fatal errors but may not result in the sniff reporting the same errors as it did previously without changes being required.

The `PATCH` version is incremented when:

- backwards-compatible bug fixes are made

> NOTE: As PHP\_CodeSniffer exists to report and fix issues, most bugs are the result of coding standard errors being incorrectly reported or coding standard errors not being reported when they should be. This means that the messages produced by PHP\_CodeSniffer, and the fixes it makes, are likely to be different between PATCH versions.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

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

2

Last Release

2586d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c209b4818ee3b767d514fbe30757b11d18459f0027bc64e294a78998a141967?d=identicon)[jacricelli](/maintainers/jacricelli)

---

Top Contributors

[![gsherwood](https://avatars.githubusercontent.com/u/185976?v=4)](https://github.com/gsherwood "gsherwood (4847 commits)")[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (419 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (40 commits)")[![gmponos](https://avatars.githubusercontent.com/u/5675248?v=4)](https://github.com/gmponos "gmponos (32 commits)")[![photodude](https://avatars.githubusercontent.com/u/10253980?v=4)](https://github.com/photodude "photodude (26 commits)")[![klausi](https://avatars.githubusercontent.com/u/213229?v=4)](https://github.com/klausi "klausi (23 commits)")[![andygrunwald](https://avatars.githubusercontent.com/u/320064?v=4)](https://github.com/andygrunwald "andygrunwald (18 commits)")[![kukulich](https://avatars.githubusercontent.com/u/260445?v=4)](https://github.com/kukulich "kukulich (12 commits)")[![rmccue](https://avatars.githubusercontent.com/u/21655?v=4)](https://github.com/rmccue "rmccue (10 commits)")[![phil-davis](https://avatars.githubusercontent.com/u/1535615?v=4)](https://github.com/phil-davis "phil-davis (10 commits)")[![aboks](https://avatars.githubusercontent.com/u/815524?v=4)](https://github.com/aboks "aboks (9 commits)")[![josephzidell](https://avatars.githubusercontent.com/u/1812443?v=4)](https://github.com/josephzidell "josephzidell (9 commits)")[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (9 commits)")[![thewilkybarkid](https://avatars.githubusercontent.com/u/1784740?v=4)](https://github.com/thewilkybarkid "thewilkybarkid (9 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (7 commits)")[![bondas83](https://avatars.githubusercontent.com/u/29758515?v=4)](https://github.com/bondas83 "bondas83 (7 commits)")[![wimg](https://avatars.githubusercontent.com/u/313511?v=4)](https://github.com/wimg "wimg (7 commits)")[![fabacino](https://avatars.githubusercontent.com/u/14901115?v=4)](https://github.com/fabacino "fabacino (7 commits)")[![thiemowmde](https://avatars.githubusercontent.com/u/6576639?v=4)](https://github.com/thiemowmde "thiemowmde (7 commits)")[![uniquexor](https://avatars.githubusercontent.com/u/6176836?v=4)](https://github.com/uniquexor "uniquexor (6 commits)")

---

Tags

standardsphpcs

### Embed Badge

![Health badge](/badges/jacricelli-php-codesniffer/health.svg)

```
[![Health](https://phpackages.com/badges/jacricelli-php-codesniffer/health.svg)](https://phpackages.com/packages/jacricelli-php-codesniffer)
```

###  Alternatives

[wp-coding-standards/wpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress coding conventions

2.7k42.5M1.6k](/packages/wp-coding-standards-wpcs)[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

596161.9M1.9k](/packages/dealerdirect-phpcodesniffer-composer-installer)[phpcompatibility/phpcompatibility-wp

A ruleset for PHP\_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.

21830.6M584](/packages/phpcompatibility-phpcompatibility-wp)[phpcsstandards/phpcsextra

A collection of sniffs and standards for use with PHP\_CodeSniffer.

10224.3M44](/packages/phpcsstandards-phpcsextra)[acquia/coding-standards

PHP\_CodeSniffer rules (sniffs) for Acquia coding standards

214.8M28](/packages/acquia-coding-standards)[moxio/php-codesniffer-sniffs

Custom sniffs for PHP\_CodeSniffer

18283.0k3](/packages/moxio-php-codesniffer-sniffs)

PHPackages © 2026

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