PHPackages                             itrocks/coding-standard - 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. itrocks/coding-standard

ActivePhpcodesniffer-standard[Testing &amp; Quality](/categories/testing)

itrocks/coding-standard
=======================

CodeSniffer ruleset for the it.rocks 0.2+ coding standard

03PHP

Since May 7Pushed 3y ago2 watchersCompare

[ Source](https://github.com/itrocks/coding-standard)[ Packagist](https://packagist.org/packages/itrocks/coding-standard)[ RSS](/packages/itrocks-coding-standard/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

it.rocks PHP CodeSNiffer Coding Standard
========================================

[](#itrocks-php-codesniffer-coding-standard)

A coding standard to check against the it.rocks coding standards.

1. Installation
---------------

[](#1-installation)

### 1.1 Composer

[](#11-composer)

This standard can be installed with Composer dependency manager:

1. Install Composer
2. Install coding standard as a dependency of your project

```
composer require --dev itrocks/coding-standard
```

3. Check the installed coding standards for "ITRocks"

```
vendor/bin/phpcs -i

```

Should display the ITRocks coding standard, between others

4. If needed, add the coding standard to the PHP\_CodeSniffer install path

```
vendor/bin/phpcs --config-set installed_paths `realpath vendor/itrocks/coding-standard/ITRocks`
```

5. Done!

```
vendor/bin/phpcs --standard=ITRocks ./
```

### 1.2 Stand-alone

[](#12-stand-alone)

1. Checkout this repository

```
git clone https://git.crafter.fr/itrocks/coding-standard
```

2. Install dependencies

```
cd coding-standard
composer install
```

3. Check the installed coding standards for "ITRocks"

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

4. If needed, add the coding standard to the PHP\_CodeSniffer install path

```
vendor/bin/phpcs --config-set installed_paths `realpath ITRocks`
```

5. Usage

```
vendor/bin/phpcs --standard=ITRocks /home/vendor/project
```

You can check that this tools himself respect ITRocks standard

```
vendor/bin/phpcs --standard=ITRocks --extensions=php $CI_PROJECT_DIR/ITRocks
```

2. Run unit tests
-----------------

[](#2-run-unit-tests)

### From the command line

[](#from-the-command-line)

Simply run

```
vendor/bin/phpunit
```

### From PHPStorm, with PHP installed locally

[](#from-phpstorm-with-php-installed-locally)

Right-click on "phpunit.xml.dist" and select "Run phpunit.xml.dist".

This works only for coding-standard being installed into a dependency of your project. If you want to run tests on a standalone mode, you have to change this file path into the phpunit.xml.dist file :

- for dependency : bootstrap="../../../vendor/squizlabs/php\_codesniffer/tests/bootstrap.php"
- for standalone : bootstrap="vendor/squizlabs/php\_codesniffer/tests/bootstrap.php"

3. PhpStorm integration
-----------------------

[](#3-phpstorm-integration)

After having [cloned this project on your disk](#12-stand-alone), you're able to integrate coding standards rules directly in PhpStorm.

Go in PhpStorm settings `Languages & Framework > PHP > Code Sniffer` to configure the path of phpcs executable:

[![PhpStorm configuration 1](doc/pstorm-config1.png "PhpStorm configuration 1")](doc/pstorm-config1.png)

Click on Apply button.

Now, go to: `Editor > Inspections > PHP > PHP Code Sniffer validation`, check the checkbox and configure as following:

[![PhpStorm configuration 2](doc/pstorm-config2.png "PhpStorm configuration 2")](doc/pstorm-config2.png)

That's it!

To inspect a file/directory, just right click on it in the project windows, select "Inspect Code...", then OK.

4. PhpStorm AutoFix
-------------------

[](#4-phpstorm-autofix)

1. Go to Settings -&gt; Tools -&gt; External tools
2. Configure the following

- Name : Apply Coding Standards
- Program : `/home/vendor/project/vendor/bin/phpcbf` (Use the path to your project)
- Arguments : `-vvv --standard=ITRocks --extensions=php,fixed.inc $FilePath$`
- Project directory : `$ProjectFileDir$`[![PhpStorm External Tool](doc/external-tool.png "PhpStorm External Tool")](doc/external-tool.png)

3. Go to Settings -&gt; Keymap -&gt; External Tools -&gt; Coding Standard

- Right click -&gt; Add Keyboard Shortcut
- Add : Ctrl+&lt;

Now you can auto-fix your php files using the Ctrl+&lt; keyboard combination, or the menu Tools -&gt; External Tools -&gt; Apply Coding Standards

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c59494f987e0e7b01198896224a0ed287c0406c2d216b9c6d7a239d912fb7c5?d=identicon)[itrocks](/maintainers/itrocks)

---

Top Contributors

[![baptistepillot](https://avatars.githubusercontent.com/u/3451236?v=4)](https://github.com/baptistepillot "baptistepillot (22 commits)")

### Embed Badge

![Health badge](/badges/itrocks-coding-standard/health.svg)

```
[![Health](https://phpackages.com/badges/itrocks-coding-standard/health.svg)](https://phpackages.com/packages/itrocks-coding-standard)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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