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

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

mich-grodno/php\_codesniffer
============================

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

4.0.1(8y ago)0880↓100%BSD-3-ClausePHPPHP &gt;=5.4.0

Since Nov 9Pushed 8y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (64)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.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.

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

[](#installation)

The easiest way to get started with PHP\_CodeSniffer is to download the Phar 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

```

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

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 90.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 ~31 days

Recently: every ~26 days

Total

63

Last Release

2957d ago

Major Versions

2.8.1 → 3.0.0RC42017-03-01

2.9.0 → 3.0.02017-05-04

2.9.1 → 3.0.12017-06-14

2.9.x-dev → 3.2.32018-02-20

3.2.3 → 4.0.02018-04-04

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

3.0.0a1PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b72612118b14ea19a0746d0ae0b392284d0bfb4c54fffb30fa425a13b55b4e85?d=identicon)[Alexander Mitskevich](/maintainers/Alexander%20Mitskevich)

---

Top Contributors

[![gsherwood](https://avatars.githubusercontent.com/u/185976?v=4)](https://github.com/gsherwood "gsherwood (4468 commits)")[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (214 commits)")[![gmponos](https://avatars.githubusercontent.com/u/5675248?v=4)](https://github.com/gmponos "gmponos (28 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (26 commits)")[![klausi](https://avatars.githubusercontent.com/u/213229?v=4)](https://github.com/klausi "klausi (23 commits)")[![photodude](https://avatars.githubusercontent.com/u/10253980?v=4)](https://github.com/photodude "photodude (21 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 (10 commits)")[![rmccue](https://avatars.githubusercontent.com/u/21655?v=4)](https://github.com/rmccue "rmccue (10 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)")[![bondas83](https://avatars.githubusercontent.com/u/29758515?v=4)](https://github.com/bondas83 "bondas83 (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)")[![kdebisschop](https://avatars.githubusercontent.com/u/1213025?v=4)](https://github.com/kdebisschop "kdebisschop (6 commits)")[![blerou](https://avatars.githubusercontent.com/u/52151?v=4)](https://github.com/blerou "blerou (6 commits)")[![uniquexor](https://avatars.githubusercontent.com/u/6176836?v=4)](https://github.com/uniquexor "uniquexor (6 commits)")[![aboks](https://avatars.githubusercontent.com/u/815524?v=4)](https://github.com/aboks "aboks (6 commits)")[![mich-grodno](https://avatars.githubusercontent.com/u/3897036?v=4)](https://github.com/mich-grodno "mich-grodno (6 commits)")[![deviantintegral](https://avatars.githubusercontent.com/u/255023?v=4)](https://github.com/deviantintegral "deviantintegral (5 commits)")

---

Tags

standardsphpcs

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/mich-grodno-php-codesniffer/health.svg)](https://phpackages.com/packages/mich-grodno-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.6M581](/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)
