PHPackages                             fnayou/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. fnayou/standards

ActiveLibrary

fnayou/standards
================

PHP Code Sniffer configurator.

1.2(9y ago)54.2kMITShell

Since Dec 10Pushed 9y ago1 watchersCompare

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

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

Standards
=========

[](#standards)

Clear and easy to use **PHP Code Sniffer** configurator.

Work with *symfony*, *laravel*, *yii* and any PHP based projects.

- [Installation](#installation)
- [Usage](#usage)
    - [Using .standards configuration file](#using-standards-configuration-file)
    - [Running command with arguments](#running-command-with-arguments)
    - [With Symfony](#with-symfony)
    - [With Laravel](#with-laravel)
    - [With Yii](#with-yii)
    - [Composer script](#composer-script)

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

[](#installation)

via `composer` and for dev :

```
$ composer require --dev fnayou/standards
```

by default, you can run command from `vendor/bin/standards`, but you can add :

```
"config": {
    "bin-dir": "bin"
}
```

and you can run command from `bin/standards`.

note that you can install globally :

```
$ composer global require fnayou/standards
```

Usage
-----

[](#usage)

### Using .standards configuration file

[](#using-standards-configuration-file)

all you have to do is to create a dot file named `.standards` in which we will have all our parameters :

```
# .standards file content

# can be phpcs or phpcbf (optional - default: phpcs)
command=phpcs

# path used to load standards (optional)
#standard-path=path/to/phpcs/standards/

# standard used by PHP CodeSniffer (required)
standard=PSR2

# verbose/debug mode (optional - default: false)
#verbose=true

# allowed files and directories (optional)
src/

# ignored files and directories (optional)
!tests

```

now all you have to do is to run command `bin\standards`.

note :

- all **ignored files or directory** should be prefixed with `!` like `!test/` or `!test.php`
- all **ignored and allowed** files/directories should be written one by line like

```
# allowed files/directories
src/
file.php

# ignored files/directories
!tests/
!test.php

```

### Running command with arguments

[](#running-command-with-arguments)

you can run command with [phpcs arguments](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) :

```
$ bin/standards src  --standard=PSR2 --ignore=tests
```

> note that this use will override configuration using `.standards` file if used.

### With Symfony

[](#with-symfony)

you have to install via `composer` :

```
$ composer require --dev fnayou/standards
$ composer require --dev escapestudios/symfony2-coding-standard
```

and next, create your `.standards` file :

```
standard=vendor/escapestudios/symfony2-coding-standard/Symfony2

# white list of files and directories
src/

# black list of files and directories
!tests

```

now, all you have to do is to run command `bin\standards`.

### With Laravel

[](#with-laravel)

you have to install via `composer` :

```
$ composer require --dev fnayou/standards
$ composer require --dev pragmarx/laravelcs
```

and next, create your `.standards` file :

```
standard=vendor/pragmarx/laravelcs/Standards/Laravel

# white list of files and directories
src/

# black list of files and directories
!tests

```

now, all you have to do is to run command `bin\standards`.

### With Yii

[](#with-yii)

you have to install via `composer` :

```
$ composer require --dev fnayou/standards
$ composer require --dev yiisoft/yii2-coding-standards
```

and next, create your `.standards` file :

```
standard=vendor/yiisoft/yii2-coding-standards/Yii2

# white list of files and directories
src/

# black list of files and directories
!tests

```

now, all you have to do is to run command `bin\standards`.

### Composer script

[](#composer-script)

you can also add a **composer script** to run command

```
"scripts": {
    "stdr": "bin/standards"
},
```

next all you have to do is to run script (can be useful with `capistrano` or/and `jenkins`)

```
composer stdr
```

Credits
-------

[](#credits)

- [Aymen FNAYOU](https://aymen-fnayou.com) - [GitHub](https://github.com/fnayou)
- Fork from the awesome [M6Web Coke](https://github.com/M6Web/Coke) so thanks ;)

Notes
-----

[](#notes)

I have forked the wonderful [M6Web Coke](https://github.com/M6Web/Coke) because the company where I'm working find that **coke** and **sniff** is not so conventional :( and they refused to used it. And honestly I don't like blue in the output :P

Todo
----

[](#todo)

- generate `.standards` file
- handle different path for command (`phpcs` installed globally)

License
-------

[](#license)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT) Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~32 days

Total

2

Last Release

3404d ago

### Community

Maintainers

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

---

Top Contributors

[![fnayou](https://avatars.githubusercontent.com/u/1094768?v=4)](https://github.com/fnayou "fnayou (7 commits)")

---

Tags

phpphpcssymfonylaravelcodeconfiguratorsnifferyii

### Embed Badge

![Health badge](/badges/fnayou-standards/health.svg)

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

###  Alternatives

[dragon-code/support

Support package is a collection of helpers and tools for any project.

238.7M100](/packages/dragon-code-support)[pragmarx/laravelcs

PHP\_CodeSniffer custom Sniff for Laravel coding standard

236111.7k2](/packages/pragmarx-laravelcs)[rumenx/php-sitemap

Framework-agnostic Sitemap generator for PHP, Laravel, and Symfony.

1.3k15.1k1](/packages/rumenx-php-sitemap)[phpmv/php-mv-ui

A JQuery and UI library for php and php MVC frameworks

3319.7k3](/packages/phpmv-php-mv-ui)[rumenx/php-feed

Framework-agnostic PHP Feed generator for Laravel, Symfony, and more.

3652.3k](/packages/rumenx-php-feed)[leroy-merlin-br/coding-standard

The coding standard for PHP projects on LMBR

2137.0k10](/packages/leroy-merlin-br-coding-standard)

PHPackages © 2026

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