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

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

wambacom/php\_codesniffer
=========================

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

2.5.1.3(10y ago)0692BSD-3-ClausePHPPHP &gt;=5.1.2

Since Nov 9Pushed 10y ago2 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (41)Used By (0)

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

The SVN pre-commit hook requires PHP version 5.2.4 or greater due to its use of the vertical whitespace character.

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

[](#installation)

The easiest way to get started with PHP\_CodeSniffer is to download the [Phar](http://php.net/manual/en/intro.phar.php) files for each of the commands:

```
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar -h

curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
php phpcbf.phar -h

```

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

```

If you prefer using [Composer](http://getcomposer.org/) you can easily install PHP\_CodeSniffer system-wide with the following command:

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

```

Make sure you have `~/.composer/vendor/bin/` in your PATH.

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

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

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

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

```

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

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

```

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

[](#documentation)

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

Information about upcoming features and releases is available on the [Squiz Labs blog](http://www.squizlabs.com/php-codesniffer).

Issues
------

[](#issues)

Bug reports and feature requests can be submitted on the [Github Issue Tracker](https://github.com/squizlabs/PHP_CodeSniffer/issues) or the [PEAR bug tracker](http://pear.php.net/package/PHP_CodeSniffer/bugs).

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

[](#contributing)

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

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 95.6% 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 ~32 days

Recently: every ~22 days

Total

40

Last Release

3725d ago

Major Versions

1.5.3 → 2.0.0a22014-05-01

1.5.4 → 2.0.0RC12014-08-06

1.5.5 → 2.0.0RC22014-09-25

1.5.6 → 2.0.02014-12-05

2.5.1 → 3.0.x-dev2016-01-21

PHP version history (2 changes)1.4.2PHP &gt;=5.1.2

3.0.x-devPHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/fcb3dfb7a027f1eb1d7efcb9eb65ee1b4575e780b3f60f9f1b0361fee30eb87a?d=identicon)[wambacom](/maintainers/wambacom)

---

Top Contributors

[![gsherwood](https://avatars.githubusercontent.com/u/185976?v=4)](https://github.com/gsherwood "gsherwood (3085 commits)")[![klausi](https://avatars.githubusercontent.com/u/213229?v=4)](https://github.com/klausi "klausi (19 commits)")[![andygrunwald](https://avatars.githubusercontent.com/u/320064?v=4)](https://github.com/andygrunwald "andygrunwald (18 commits)")[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (9 commits)")[![wimg](https://avatars.githubusercontent.com/u/313511?v=4)](https://github.com/wimg "wimg (7 commits)")[![kukulich](https://avatars.githubusercontent.com/u/260445?v=4)](https://github.com/kukulich "kukulich (7 commits)")[![aboks](https://avatars.githubusercontent.com/u/815524?v=4)](https://github.com/aboks "aboks (6 commits)")[![blerou](https://avatars.githubusercontent.com/u/52151?v=4)](https://github.com/blerou "blerou (6 commits)")[![kdebisschop](https://avatars.githubusercontent.com/u/1213025?v=4)](https://github.com/kdebisschop "kdebisschop (6 commits)")[![westonruter](https://avatars.githubusercontent.com/u/134745?v=4)](https://github.com/westonruter "westonruter (5 commits)")[![deviantintegral](https://avatars.githubusercontent.com/u/255023?v=4)](https://github.com/deviantintegral "deviantintegral (5 commits)")[![pfrenssen](https://avatars.githubusercontent.com/u/442924?v=4)](https://github.com/pfrenssen "pfrenssen (4 commits)")[![robocoder](https://avatars.githubusercontent.com/u/922051?v=4)](https://github.com/robocoder "robocoder (4 commits)")[![illusori](https://avatars.githubusercontent.com/u/360670?v=4)](https://github.com/illusori "illusori (4 commits)")[![ktomk](https://avatars.githubusercontent.com/u/352517?v=4)](https://github.com/ktomk "ktomk (4 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (4 commits)")[![mathroc](https://avatars.githubusercontent.com/u/291531?v=4)](https://github.com/mathroc "mathroc (3 commits)")[![ajgarlag](https://avatars.githubusercontent.com/u/388184?v=4)](https://github.com/ajgarlag "ajgarlag (3 commits)")[![mipxtx](https://avatars.githubusercontent.com/u/2456779?v=4)](https://github.com/mipxtx "mipxtx (3 commits)")[![kenguest](https://avatars.githubusercontent.com/u/234118?v=4)](https://github.com/kenguest "kenguest (3 commits)")

---

Tags

standardsphpcs

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[wp-coding-standards/wpcs

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

2.8k47.8M2.1k](/packages/wp-coding-standards-wpcs)[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

601175.5M2.3k](/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.

22134.3M729](/packages/phpcompatibility-phpcompatibility-wp)[phpcsstandards/phpcsextra

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

10329.7M62](/packages/phpcsstandards-phpcsextra)[acquia/coding-standards

PHP\_CodeSniffer rules (sniffs) for Acquia coding standards

225.0M34](/packages/acquia-coding-standards)[rarst/phpcs-cognitive-complexity

Cognitive complexity implementation for PHP\_CodeSniffer

28134.7k3](/packages/rarst-phpcs-cognitive-complexity)

PHPackages © 2026

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