PHPackages                             smgladkovskiy/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. [Testing &amp; Quality](/categories/testing)
4. /
5. smgladkovskiy/phpcs-git-pre-commit

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

smgladkovskiy/phpcs-git-pre-commit
==================================

PHPCS check before commit

4033.1k↓29.8%33[1 issues](https://github.com/smgladkovskiy/phpcs-git-pre-commit/issues)3Shell

Since Apr 12Pushed 2y ago2 watchersCompare

[ Source](https://github.com/smgladkovskiy/phpcs-git-pre-commit)[ Packagist](https://packagist.org/packages/smgladkovskiy/phpcs-git-pre-commit)[ RSS](/packages/smgladkovskiy-phpcs-git-pre-commit/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (3)

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 `smgladkovskiy/phpcs-git-pre-commit` with composer require command:

```
composer require --dev "smgladkovskiy/phpcs-git-pre-commit"

```

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

```
{
    "require-dev": {
        "smgladkovskiy/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": {
    "install-hooks": ["sh ./vendor/smgladkovskiy/phpcs-git-pre-commit/src/setup.sh"],
    "post-install-cmd": ["@install-hooks"],
    "post-update-cmd": ["@install-hooks"]
}

```

Then run `composer install` or `composer update`. `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

```

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

[](#contributing)

Feel free to make pull requests!

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% 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://avatars.githubusercontent.com/u/128070?v=4)[Sergey Gladkovskiy](/maintainers/smgladkovskiy)[@smgladkovskiy](https://github.com/smgladkovskiy)

---

Top Contributors

[![smgladkovskiy](https://avatars.githubusercontent.com/u/128070?v=4)](https://github.com/smgladkovskiy "smgladkovskiy (12 commits)")[![sreichel](https://avatars.githubusercontent.com/u/5022236?v=4)](https://github.com/sreichel "sreichel (4 commits)")[![boryn](https://avatars.githubusercontent.com/u/807297?v=4)](https://github.com/boryn "boryn (1 commits)")[![michnovka](https://avatars.githubusercontent.com/u/16553087?v=4)](https://github.com/michnovka "michnovka (1 commits)")

### Embed Badge

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

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

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14429.2M361](/packages/dms-phpunit-arraysubset-asserts)[gong023/assert_chain

enable you to use phpunit assert with method chain

1478.9k3](/packages/gong023-assert-chain)

PHPackages © 2026

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