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

3931.0k—2.9%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 1mo ago

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

29

—

LowBetter than 59% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity26

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://www.gravatar.com/avatar/9edd0d9dbbfc1a0ed169fa0e6b76cd7d1116376e3dae1d37653b54faea056b79?d=identicon)[smgladkovskiy](/maintainers/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

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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