PHPackages                             nafigator/php-qa-hooks - 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. nafigator/php-qa-hooks

ActiveLibrary

nafigator/php-qa-hooks
======================

Git hooks for PHP commits QA.

1.0.6(4y ago)58.8k↓100%1MITShell

Since Aug 6Pushed 4y ago3 watchersCompare

[ Source](https://github.com/nafigator/php-qa-hooks)[ Packagist](https://packagist.org/packages/nafigator/php-qa-hooks)[ RSS](/packages/nafigator-php-qa-hooks/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (27)Used By (0)

[![GitHub license](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](https://tldrlegal.com/license/mit-license) [![GitHub release](https://camo.githubusercontent.com/88dea404b0e8beaab51479d9fcefa0de72e3a36da9d7c467d3ee3c5997cc3d83/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72656c656173652d312e302e362d627269676874677265656e2e737667)](https://github.com/nafigator/php-qa-hooks) [![Conventional Commits](https://camo.githubusercontent.com/90d8aeee02dec6f5ceeb0423b9ba1aea93519cadbfcb13d62770ac6550780d6e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e76656e74696f6e616c253230436f6d6d6974732d312e302e302d79656c6c6f772e737667)](https://conventionalcommits.org) [![Semantic Versioning](https://camo.githubusercontent.com/e85a48218ed6fed6b3b6c2c74d8d937a018bd8dfd352ee4d665a18aa0a040f0f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656d616e74696325323056657273696f6e696e672d322e302e302d627269676874677265656e2e737667)](https://semver.org)

PHP QA git hooks
================

[](#php-qa-git-hooks)

Git hooks for PHP commits quality assurance

[![pre-commit output example](https://github.com/nafigator/git-hooks/raw/master/.images/pre-commit.jpg)](https://github.com/nafigator/git-hooks/raw/master/.images/pre-commit.jpg)

### Requirements

[](#requirements)

- git
- bash
- PHP CLI
- Core utils

### Features

[](#features)

- Customization by git config options
- Check for PHP syntax before commit
- Check for Git conflict markups before commit
- Warn about PHP dump functions (var\_dump(), var\_export(), print\_r())
- Check PHP code style before push
- Run PHPUnit tests before push
- Colored output

### Install via Composer

[](#install-via-composer)

1. Install package:

    ```
     composer require --dev nafigator/php-qa-hooks

    ```
2. Add *extra* section to *composer.json*:

    ```
     "extra": {
         "scripts-dev": {
             "post-install-cmd": "vendor/nafigator/php-qa-hooks/src/hooks-install.sh"
         }
     }

    ```
3. Place *phpcs.xml* into root of your project.

    > NOTE: An example phpcs.xml file can be found in the PHP\_CodeSniffer repository: [phpcs.xml.dist](https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/3.4.2/phpcs.xml.dist)
4. Run `composer install`.

### Uninstall

[](#uninstall)

1. Remove git config section `check.php`

    ```
     git config --remove-section check.php

    ```
2. Add *extra* section to *composer.json*:

    ```
     "extra": {
         "scripts-dev": {
             "post-install-cmd": "vendor/nafigator/php-qa-hooks/src/hooks-uninstall.sh"
         }
     }

    ```

    Commit and push your changes to repository. When uninstall script completes cleanup for all work copies, move to next step.
3. Remove package:

    ```
     composer remove --dev nafigator/php-qa-hooks

    ```
4. Remove *phpcs.xml* from root ot your project.

### Configuration

[](#configuration)

Example (colors off):

```
git config check.php.colors false

```

Available git config options:

```
check.php.colors [true|false]
check.php.conflicts [true|false]
check.php.dumps [true|false]
check.php.phpunit [true|false]
check.php.style [true|false]
check.php.syntax [true|false]

```

> NOTE: PHPUnit disabled by default. You need to enable it manually.

### Versioning

[](#versioning)

This software follows *"Semantic Versioning"* specifications. All function signatures declared as public API.

Read more on [SemVer.org](http://semver.org).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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 ~29 days

Recently: every ~131 days

Total

26

Last Release

1743d ago

Major Versions

0.7.0 → 1.0.02019-09-01

### Community

Maintainers

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

---

Top Contributors

[![nafigator](https://avatars.githubusercontent.com/u/1971423?v=4)](https://github.com/nafigator "nafigator (69 commits)")[![Phrlog](https://avatars.githubusercontent.com/u/9060150?v=4)](https://github.com/Phrlog "Phrlog (1 commits)")

---

Tags

bash-scriptcode-standardcode-stylegitgit-conflictsgit-hooksphpphp-syntaxphpCode stylegitcode standardgit-hooksbash-scriptgit-conflictsphp-syntax

### Embed Badge

![Health badge](/badges/nafigator-php-qa-hooks/health.svg)

```
[![Health](https://phpackages.com/badges/nafigator-php-qa-hooks/health.svg)](https://phpackages.com/packages/nafigator-php-qa-hooks)
```

###  Alternatives

[kohana/coding-standards

PHP\_CodeSniffer rules for the Kohana Framework coding style

5817.6k](/packages/kohana-coding-standards)[h4cc/phpqatools

A meta composer package for PHP QA Tools.

6418.6k1](/packages/h4cc-phpqatools)[robiningelbrecht/phpunit-coverage-tools

PHPUnit coverage tools

1783.0k33](/packages/robiningelbrecht-phpunit-coverage-tools)[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)
