PHPackages                             bugatino/phpcs-git-pre-commit - 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. bugatino/phpcs-git-pre-commit

ActiveScripts

bugatino/phpcs-git-pre-commit
=============================

Setup PHPCS for checking PSR-2 standard using composer and git pre-commit hook.

v1.0.0(7y ago)14.0k1MITShell

Since May 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/bugatino/phpcs-git-pre-commit)[ Packagist](https://packagist.org/packages/bugatino/phpcs-git-pre-commit)[ Docs](https://github.com/bugatino/phpcs-git-pre-commit)[ RSS](/packages/bugatino-phpcs-git-pre-commit/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

PHPCS git pre-commit hook
=========================

[](#phpcs-git-pre-commit-hook)

About
-----

[](#about)

Auto installed git pre-commit hook for running [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer)code checking to PSR2 coding standard compliance. It checks only files that are to be committed.

Inspired by [Enforce code standards with composer, git hooks, and phpcs](http://tech.zumba.com/2014/04/14/control-code-quality/)

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

[](#installation)

Install `bugatino/phpcs-git-pre-commit` with composer require command:

```
composer require "bugatino/phpcs-git-pre-commit"

```

Or alternatively, include a dependency for `bugatino/phpcs-git-pre-commit` in your composer.json file manually:

```
{
    "require-dev": {
        "bugatino/phpcs-git-pre-commit": "dev-master"
    }
}

```

To enable code sniff, аdd to `post-install-cmd` and `post-update-cmd` in `composer.json` installation script:

```
"scripts": {
    "post-install-cmd": [
        "sh ./vendor/bugatino/phpcs-git-pre-commit/src/setup.sh"
    ],
    "post-update-cmd": [
        "sh ./vendor/bugatino/phpcs-git-pre-commit/src/setup.sh"
    ]
}

```

Then run `composer install` or `composer update` using `Git Bash`. `pre-commit` hook will be installed or updated if it already exists.

Usage
-----

[](#usage)

Run `git commit` and pre-commit hook will check your committed files like if you run

```
    php phpcs.phar --standard=PSR2 --encoding=utf-8 -n -p /path/to/file.php

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 52.9% 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

Unknown

Total

1

Last Release

2908d ago

### Community

Maintainers

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

---

Top Contributors

[![smgladkovskiy](https://avatars.githubusercontent.com/u/128070?v=4)](https://github.com/smgladkovskiy "smgladkovskiy (9 commits)")[![bugatino](https://avatars.githubusercontent.com/u/9136786?v=4)](https://github.com/bugatino "bugatino (8 commits)")

---

Tags

phpphpcsgitpre-commitgit hookpsr2

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/bugatino-phpcs-git-pre-commit/health.svg)

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

###  Alternatives

[wcm/git-php-hooks

Write git hooks with PHP, organize them on a per-project base and automatically add them

6441.1k3](/packages/wcm-git-php-hooks)[wcm/git-php-hooks-library

A collection of Git PHP Hooks

1210.1k3](/packages/wcm-git-php-hooks-library)

PHPackages © 2026

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