PHPackages                             joaorobertopb/php-githook-sniffer - 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. joaorobertopb/php-githook-sniffer

ActiveLibrary

joaorobertopb/php-githook-sniffer
=================================

Php-GitHook-Sniffer is a simple collection of automated and customizable tasks that you can perform with your git repository through the hooks.

0.0.5(8y ago)210MITPHPPHP ^5.6 || &gt;=7.0 &lt;7.3

Since Aug 19Pushed 7y ago3 watchersCompare

[ Source](https://github.com/joaorobertopb/php-githook-sniffer)[ Packagist](https://packagist.org/packages/joaorobertopb/php-githook-sniffer)[ Docs](https://github.com/especializati/php-githook-sniffer)[ RSS](/packages/joaorobertopb-php-githook-sniffer/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Php GitHook Sniffer
===================

[](#php-githook-sniffer)

[README em Português](README-pt_BR.md).

[![Build Status](https://camo.githubusercontent.com/29fcc8ce66e6243392ec5a33b2496f02537e510d9c143a28d83953fc83db83bd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6f616f726f626572746f70622f7068702d676974686f6f6b2d736e69666665722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/joaorobertopb/php-githook-sniffer/build-status/master) [![Latest Stable Version](https://camo.githubusercontent.com/ac2d90c7a3aa4abf4b2afd5f16b3db71e48fd026d6ea2129c4065969a9f2311a/68747470733a2f2f706f7365722e707567782e6f72672f6a6f616f726f626572746f70622f7068702d676974686f6f6b2d736e69666665722f762f737461626c65)](https://packagist.org/packages/joaorobertopb/php-githook-sniffer) [![Total Downloads](https://camo.githubusercontent.com/2e0c00d483c0e36ba6de4653c4a73243b3388af7fe82b4120e29743d5de5ef8c/68747470733a2f2f706f7365722e707567782e6f72672f6a6f616f726f626572746f70622f7068702d676974686f6f6b2d736e69666665722f646f776e6c6f616473)](https://packagist.org/packages/joaorobertopb/php-githook-sniffer) [![Latest Unstable Version](https://camo.githubusercontent.com/2685b224d4e237d91da19cba0092d05f8f18a704665d7101baef762eb80b644f/68747470733a2f2f706f7365722e707567782e6f72672f6a6f616f726f626572746f70622f7068702d676974686f6f6b2d736e69666665722f762f756e737461626c65)](https://packagist.org/packages/joaorobertopb/php-githook-sniffer) [![Code Coverage](https://camo.githubusercontent.com/217307ddf366514d79d6034e49eb49ad17e2653cb63d11f6093b963a2f5b64ff/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a6f616f726f626572746f70622f7068702d676974686f6f6b2d736e69666665722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/joaorobertopb/php-githook-sniffer/?branch=master) [![Quality Score](https://camo.githubusercontent.com/a1fdedd8a06b2704caf027f03e91767818f4f624f7151cac12c6c66e1778b38d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6a6f616f726f626572746f70622f7068702d676974686f6f6b2d736e69666665722e737667)](https://scrutinizer-ci.com/g/joaorobertopb/php-githook-sniffer) [![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)

Php-GitHook-Sniffer is a simple collection of automated tasks that you can perform with your git repository through the hooks.

### Available hooks

[](#available-hooks)

- pre-commit

### pre-commit

[](#pre-commit)

Check the commited files:

- Check PHP Syntax (with PHPLint)
- Fix code style according to PSR2 standard

#### Examples

[](#examples)

##### verifying syntax:

[](#verifying-syntax)

[![php-lint](https://camo.githubusercontent.com/7a351115ff2c70d75e89aacf1e34758a347303bf36afd979f184bb5e958a2b34/68747470733a2f2f692e696d6775722e636f6d2f537078383146482e706e67)](https://camo.githubusercontent.com/7a351115ff2c70d75e89aacf1e34758a347303bf36afd979f184bb5e958a2b34/68747470733a2f2f692e696d6775722e636f6d2f537078383146482e706e67)

##### Applying PSR2 rules:

[](#applying-psr2-rules)

[![php-cs-fix](https://camo.githubusercontent.com/c82ebdbbb0a02a3608bb0a10428efd6c18428ed543a1c5ef9d030aa5720187f8/68747470733a2f2f692e696d6775722e636f6d2f613632774156502e706e67)](https://camo.githubusercontent.com/c82ebdbbb0a02a3608bb0a10428efd6c18428ed543a1c5ef9d030aa5720187f8/68747470733a2f2f692e696d6775722e636f6d2f613632774156502e706e67)

### Other Hooks

[](#other-hooks)

Coming Soon.

Install
-------

[](#install)

Add `joaorobertopb/php-githook-sniffer` as a development dependency in `composer.json`

```
"require-dev": {
    "joaorobertopb/php-githook-sniffer": "~0.0.5"
}

```

Or via Composer

```
$ composer require joaorobertopb/php-githook-sniffer --dev
```

Copy src/Hooks/pre-commit for .git/hooks. ( Execution Permission Required )

```
$ php -r "if(file_exists('./.git')&&file_exists('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit')){copy('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0777);}"
```

or

```
"scripts": {
    "post-install-cmd": [
      "php -r \"if(file_exists('./.git')&&file_exists('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit')){copy('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0777);}\""
    ],
    "post-update-cmd": [
      "php -r \"if(file_exists('./.git')&&file_exists('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit')){copy('./vendor/joaorobertopb/php-githook-sniffer/src/Hooks/pre-commit','./.git/hooks/pre-commit');chmod('./.git/hooks/pre-commit',0777);}\""
    ]
}

```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

Coming Soon.

Credits
-------

[](#credits)

- [João Roberto](https://github.com/joaorobertopb)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96% 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 ~47 days

Total

5

Last Release

3000d ago

PHP version history (3 changes)0.0.1PHP ^5.6 || &gt;=7.0 &lt;7.2

0.0.3PHP ^5.6 || ^7.0

0.0.5PHP ^5.6 || &gt;=7.0 &lt;7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/070d4c9402e25d53f88b30cbfe28e2f9e6a316bddc123e85bc37c8e853e27750?d=identicon)[joaorobertopb](/maintainers/joaorobertopb)

---

Top Contributors

[![joaorobertopb](https://avatars.githubusercontent.com/u/6556083?v=4)](https://github.com/joaorobertopb "joaorobertopb (24 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

hookspre-commitespecializatiphp-githook-sniffer

### Embed Badge

![Health badge](/badges/joaorobertopb-php-githook-sniffer/health.svg)

```
[![Health](https://phpackages.com/badges/joaorobertopb-php-githook-sniffer/health.svg)](https://phpackages.com/packages/joaorobertopb-php-githook-sniffer)
```

###  Alternatives

[captainhook/captainhook

PHP git hook manager

1.1k6.8M370](/packages/captainhook-captainhook)[sabre/event

sabre/event is a library for lightweight event-based programming

35227.4M25](/packages/sabre-event)[tormjens/eventy

The WordPress filter/action system in Laravel

438912.9k16](/packages/tormjens-eventy)[larapack/hooks

A Laravel Hook system

2171.5M21](/packages/larapack-hooks)[larapack/voyager-hooks

Hooks integrated in Voyager

2031.5M28](/packages/larapack-voyager-hooks)[projektgopher/whisky

A simple CLI tool for managing a project's git hooks across multiple members.

241281.3k20](/packages/projektgopher-whisky)

PHPackages © 2026

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