PHPackages                             itcig/php-coding-standards - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. itcig/php-coding-standards

ActivePhpcodesniffer-standard[PSR &amp; Standards](/categories/psr-standards)

itcig/php-coding-standards
==========================

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

0.6.0(2y ago)03.7k3MITPHP ^7.2 || ^8

Since Oct 12Pushed 2y ago3 watchersCompare

[ Source](https://github.com/itcig/php-coding-standards)[ Packagist](https://packagist.org/packages/itcig/php-coding-standards)[ RSS](/packages/itcig-php-coding-standards/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (7)Versions (9)Used By (3)

PHP Codesniffer Rulesets + Sniffs
=================================

[](#php-codesniffer-rulesets--sniffs)

Using CIG PHP coding standards ruleset for PHP*CodeSniffer, you can analyse the codebase of your project for PHP compatibility with other \_itcig* projects.

What's in this repo ?
---------------------

[](#whats-in-this-repo-)

A ruleset for PHP*CodeSniffer to check for PHP compatibility and standards across all \_itcig* PHP projects.

This WordPress specific ruleset prevents false positives from the [PHPCompatibility standard](https://github.com/PHPCompatibility/PHPCompatibility)by excluding back-fills and poly-fills which are provided by WordPress.

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

[](#requirements)

> These will all be installed automatically by this ruleset so you do not need to include them explicitly.

- [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer). Use the latest stable release of [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for the best results. The minimum *recommended* version of PHP\_CodeSniffer is version 3.0.2.
- [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility)9.0.0+.

Installation instructions
-------------------------

[](#installation-instructions)

The only supported installation method is via [Composer](https://getcomposer.org/).

If you already have a Composer PHP\_CodeSniffer plugin installed, run:

```
composer require --dev itcig/php-coding-standards:"*"
composer install
```

Next, run:

```
vendor/bin/phpcs -i
```

If all went well, you will now see that the `CIG`, `CIG-Docs`, `CIG-Wordpress`, `CIG-Core`, `PHPCompatibility`, `PHPCompatibilityWP` and some more PHPCompatibility standards are installed for PHP\_CodeSniffer.

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

[](#how-to-use)

Now you can use the following command to inspect your code:

```
./vendor/bin/phpcs -p . --standard=CIG
```

By default, you will only receive notifications about formatting and deprecated and/or removed PHP features.

To get the most out of the CIG coding and PHPCompatibility standards, you should specify a `testVersion` to check against. That will enable the checks for both deprecated/removed PHP features as well as the detection of code using new PHP features.

If you want to enforce the minimum PHP requirement, either add `--runtime-set testVersion 7.2-` to your command-line command or add `` to your [custom ruleset](https://github.com/PHPCompatibility/PHPCompatibility#using-a-custom-ruleset).

For example:

```
# For a project which should be compatible with PHP 7.2 and higher:
./vendor/bin/phpcs -p . --standard=CIG --runtime-set testVersion 7.2-
```

For more detailed information about setting the `testVersion`, see the README of the generic [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions)standard.

### Testing PHP files only

[](#testing-php-files-only)

By default PHP\_CodeSniffer will analyse PHP, JavaScript and CSS files. As the PHPCompatibility sniffs only target PHP code, you can make the run slightly faster by telling PHP\_CodeSniffer to only check PHP files, like so:

```
./vendor/bin/phpcs -p . --standard=CIG --extensions=php --runtime-set testVersion 7.2-
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~138 days

Recently: every ~169 days

Total

6

Last Release

853d ago

### Community

Maintainers

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

---

Top Contributors

[![unfrgivn](https://avatars.githubusercontent.com/u/1675472?v=4)](https://github.com/unfrgivn "unfrgivn (18 commits)")[![skwid138](https://avatars.githubusercontent.com/u/7584218?v=4)](https://github.com/skwid138 "skwid138 (6 commits)")

---

Tags

standardsphpcswordpress

### Embed Badge

![Health badge](/badges/itcig-php-coding-standards/health.svg)

```
[![Health](https://phpackages.com/badges/itcig-php-coding-standards/health.svg)](https://phpackages.com/packages/itcig-php-coding-standards)
```

###  Alternatives

[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)[automattic/vipwpcs

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

25510.2M145](/packages/automattic-vipwpcs)[wp-coding-standards/wpcs

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

2.7k42.5M1.6k](/packages/wp-coding-standards-wpcs)[wptrt/wpthemereview

PHP\_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org

217736.5k29](/packages/wptrt-wpthemereview)[inpsyde/php-coding-standards

PHP 7.4+ coding standards for Syde WordPress projects.

101163.9k45](/packages/inpsyde-php-coding-standards)[infinum/eightshift-coding-standards

Eightshift WordPress Coding Standards

1785.2k3](/packages/infinum-eightshift-coding-standards)

PHPackages © 2026

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