PHPackages                             mnapoli/sniff - 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. mnapoli/sniff

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

mnapoli/sniff
=============

A simpler PHP code sniffer and fixer

0.1.3(9y ago)1449[2 issues](https://github.com/mnapoli/sniff/issues)MITPHPPHP &gt;=5.6

Since Apr 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mnapoli/sniff)[ Packagist](https://packagist.org/packages/mnapoli/sniff)[ RSS](/packages/mnapoli-sniff/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Sniff
=====

[](#sniff)

Simpler PHP code sniffer, built on top of [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer).

**This project has been replaced by [Pretty](https://github.com/mnapoli/pretty)**

[![Build Status](https://camo.githubusercontent.com/bf1417ff869ba725507e8a1040ca621c5560bb294a44667abe1d9ea933dc44cf/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d6e61706f6c692f736e6966662f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/mnapoli/sniff)

Why?
----

[](#why)

[PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) can validate and fix the formatting of your code.

Sniff is a command that wraps `php-cs-fixer` to make it easier to use and configure.

It boils down to a simple `.sniff.json` file and 3 commands:

```
$ sniff validate
```

Validates that your code complies with your coding standard. Useful in CI to run on each pull request or commit.

```
$ sniff diff
```

Validates that your code complies with your coding standard and outputs the diff necessary to fix the errors. Useful to review the fixes before applying them.

```
$ sniff fix
```

Fix your code to make it compliant with your coding standard.

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

[](#installation)

```
composer require mnapoli/sniff

```

You can then invoke the command with:

```
$ vendor/bin/sniff
```

You can also install it globally with Composer to be able to call it with `sniff`:

- `composer global require mnapoli/sniff`
- add the `~/.composer/bin` path to your `PATH`

Configuration
-------------

[](#configuration)

Sniff is configured using a `.sniff.json` file:

```
{
    "paths": [
        "src",
        "tests"
    ],
    "rules": {
        "@PSR2": true
    },
    "allow-risky": true
}
```

- `paths` (**mandatory**): list of directories or files to analyze
- `rules` (default: `@PSR2`): list of rules to enable (detailed below)
- `allow-risky` (default: no): allows you to set whether risky rules may run (a risky rule is a rule which could change the code's behaviour)

The complete list of rules is detailed in [PHP-CS-Fixer's documentation](https://github.com/FriendsOfPHP/PHP-CS-Fixer#usage).

Below is an example that enables PSR-2 + Symfony's coding standard, along with a few custom options:

```
{
    "paths": [ ... ],
    "rules": {
        "@PSR2": true,
        "@Symfony": true,
        "array_syntax": {
            "syntax": "short"
        },
        "blank_line_before_return": false
    }
}
```

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

[](#contributing)

To run the tests:

```
$ composer tests

```

Credits
-------

[](#credits)

This project is only a small wrapper above [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), a huge thanks to the contributors of that tool.

Sniff is heavily inspired from [Coke](https://github.com/M6Web/Coke), a nice wrapper for [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer).

License
-------

[](#license)

Sniff is licensed under the [MIT license](LICENSE).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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 ~0 days

Total

4

Last Release

3348d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/329a6111724074f5388e95dd41a03ccf3c43f4bfe1ecf27c94c9efc6f7823228?d=identicon)[mnapoli](/maintainers/mnapoli)

---

Top Contributors

[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (11 commits)")

---

Tags

coding-standardsphpphp-codesnifferphp-cs-fixerpsr-1psr-2

### Embed Badge

![Health badge](/badges/mnapoli-sniff/health.svg)

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

###  Alternatives

[kubawerlos/php-cs-fixer-custom-fixers

A set of custom fixers for PHP CS Fixer

23912.8M188](/packages/kubawerlos-php-cs-fixer-custom-fixers)[ergebnis/php-cs-fixer-config

Provides a configuration factory and rule set factories for friendsofphp/php-cs-fixer.

703.0M200](/packages/ergebnis-php-cs-fixer-config)

PHPackages © 2026

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