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

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

devchainsrl/phpcs-phpcbf-git-pre-commit
=======================================

PHPCS check before commit

07Shell

Since Apr 20Pushed 5y agoCompare

[ Source](https://github.com/devchainsrl/phpcs-phpcbf-git-pre-commit)[ Packagist](https://packagist.org/packages/devchainsrl/phpcs-phpcbf-git-pre-commit)[ RSS](/packages/devchainsrl-phpcs-phpcbf-git-pre-commit/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

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": {
        "devchainsrl/phpcs-phpcbf-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/devchainsrl/phpcs-phpcbf-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 phpcbf.phar --standard=PSR12 --encoding=utf-8 -n -p /path/to/file.php
php phpcs.phar --standard=PSR12 --encoding=utf-8 -n -p /path/to/file.php

```

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

[](#contributing)

Feel free to make pull requests!

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 50% 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/c173326fcc83c5ab97ccbd334b00bb594e020aaf0abb05590856b4f70586f648?d=identicon)[gabidj](/maintainers/gabidj)

---

Top Contributors

[![smgladkovskiy](https://avatars.githubusercontent.com/u/128070?v=4)](https://github.com/smgladkovskiy "smgladkovskiy (12 commits)")[![gabidj](https://avatars.githubusercontent.com/u/3998573?v=4)](https://github.com/gabidj "gabidj (8 commits)")[![sreichel](https://avatars.githubusercontent.com/u/5022236?v=4)](https://github.com/sreichel "sreichel (4 commits)")

### Embed Badge

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

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

###  Alternatives

[dms/phpunit-arraysubset-asserts

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

14228.7M340](/packages/dms-phpunit-arraysubset-asserts)[orchestra/workbench

Workbench Companion for Laravel Packages Development

8219.1M69](/packages/orchestra-workbench)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

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