PHPackages                             snapp-food/git-phpcs - 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. snapp-food/git-phpcs

ActiveLibrary

snapp-food/git-phpcs
====================

Diff Sniffer for Git

0.1.2(7y ago)072MITPHPPHP ^7.1

Since Dec 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/snapp-food/git-phpcs)[ Packagist](https://packagist.org/packages/snapp-food/git-phpcs)[ RSS](/packages/snapp-food-git-phpcs/feed)WikiDiscussions master Synced 3d ago

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

Diff Sniffer for Git
====================

[](#diff-sniffer-for-git)

[![PHP Version](https://camo.githubusercontent.com/2dcf2757d7a2ae7d144c6e7d9b63bd3383509e6b70bacccb3bd8ad04d1c2541c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e312d626c75652e737667)](https://packagist.org/packages/diff-sniffer/git)[![Latest Stable Version](https://camo.githubusercontent.com/8a6b42b8774486758fc75c36c1f6b1bb9d96f452ff0bd4e6c474506cd1ff22ec/68747470733a2f2f706f7365722e707567782e6f72672f646966662d736e69666665722f6769742f762f737461626c65)](https://packagist.org/packages/diff-sniffer/git)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c56a11e1791554692d06b26cfd5d0eb8bf794adf7d3124d155f90b18c7381952/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646966662d736e69666665722f6769742f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/diff-sniffer/git/)[![Code Coverage](https://camo.githubusercontent.com/0b17a63a632c616d326024770be73c4a68a03383a2c9119e832aa6922dbe78db/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646966662d736e69666665722f6769742f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/diff-sniffer/git/)[![Build Status](https://camo.githubusercontent.com/36519e4808c5f844220e15e9a98512127e2070f7abaa104dc2e488fefeb97bbc/68747470733a2f2f7472617669732d63692e6f72672f646966662d736e69666665722f6769742e706e67)](https://travis-ci.org/diff-sniffer/git)[![Appveyor Build Status](https://camo.githubusercontent.com/f83afa229095befe3fbaf6ec94718f0524160ad8d1123e6932d01e04f48b2107/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f75763178626a376c376c7570677874613f7376673d74727565)](https://ci.appveyor.com/project/morozov/git)

This tool allows you using [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) as a pre-commit hook. The main difference from [existing solutions](https://github.com/s0enke/git-hooks/blob/master/phpcs-pre-commit/pre-commit) that this one validates only changed lines of code but not the whole source tree.

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

[](#installation)

Diff Sniffer is already built as a PHAR package. All you need is download it and install as a pre-commit hook.

```
$ wget https://github.com/diff-sniffer/git/releases/download/0.1.0/pre-commit.phar
$ chmod +x pre-commit.phar
$ mv pre-commit.phar /path/to/repo/.git/hooks/pre-commit

```

Alternatively, you can install the hook globally for a user (see [`man githooks`](https://git-scm.com/docs/githooks)):

```
$ git config --global core.hooksPath '~/.git/hooks' # choose a path if you already haven't
$ chmod +x pre-commit.phar
$ mv pre-commit.phar ~/.git/hooks/pre-commit

```

You can also install Diff Sniffer manually:

```
$ git clone git@github.com:diff-sniffer/git.git
$ cd diff-sniffer-pre-commit
$ composer install
$ bin/pre-commit --version

```

Continuous integration mode
---------------------------

[](#continuous-integration-mode)

Diff Sniffer for Git can also run on a CI server and validate pull requests. For example, on Travis CI:

```
$ wget https://github.com/diff-sniffer/git/releases/download/0.1.0/git-phpcs.phar
$ php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA

```

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

[](#configuration)

By default, the PHAR distribution uses the PSR2 coding standard. The configuration may be overridden by creating [configuration file](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file) file in the project root.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% 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 ~80 days

Total

3

Last Release

2909d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/70bbbc01cbeb80dc0e56039b33253d86030ef4bf56944b8a078ca87309568bcd?d=identicon)[modiamir](/maintainers/modiamir)

---

Top Contributors

[![morozov](https://avatars.githubusercontent.com/u/59683?v=4)](https://github.com/morozov "morozov (64 commits)")[![modiamir](https://avatars.githubusercontent.com/u/14848122?v=4)](https://github.com/modiamir "modiamir (4 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/snapp-food-git-phpcs/health.svg)

```
[![Health](https://phpackages.com/badges/snapp-food-git-phpcs/health.svg)](https://phpackages.com/packages/snapp-food-git-phpcs)
```

PHPackages © 2026

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