PHPackages                             bernardosilva/git-hooks-installer-plugin - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bernardosilva/git-hooks-installer-plugin

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

bernardosilva/git-hooks-installer-plugin
========================================

1.2.1(8y ago)1462.1k3[1 PRs](https://github.com/BernardoSilva/git-hooks-installer-plugin/pulls)2MITPHP

Since Oct 17Pushed 4y ago2 watchersCompare

[ Source](https://github.com/BernardoSilva/git-hooks-installer-plugin)[ Packagist](https://packagist.org/packages/bernardosilva/git-hooks-installer-plugin)[ RSS](/packages/bernardosilva-git-hooks-installer-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (19)Used By (2)

git-hooks-installer-plugin
==========================

[](#git-hooks-installer-plugin)

[![Latest Stable Version](https://camo.githubusercontent.com/6658b3c1a0bbab985412c2fa420dff56fd0284b0215dd7bd0f3370e13f4ddb43/68747470733a2f2f706f7365722e707567782e6f72672f6265726e6172646f73696c76612f6769742d686f6f6b732d696e7374616c6c65722d706c7567696e2f762f737461626c65)](https://packagist.org/packages/bernardosilva/git-hooks-installer-plugin)[![Total Downloads](https://camo.githubusercontent.com/29c6e03f7be80ca711bdeef3d574c7b40df20d5251fee1f4e5a05d74281191d8/68747470733a2f2f706f7365722e707567782e6f72672f6265726e6172646f73696c76612f6769742d686f6f6b732d696e7374616c6c65722d706c7567696e2f646f776e6c6f616473)](https://packagist.org/packages/bernardosilva/git-hooks-installer-plugin)[![Monthly Downloads](https://camo.githubusercontent.com/0a83c8f995b762bc0cb467191c7c69a703dd690fb7de4472ca73eb95860605ac/68747470733a2f2f706f7365722e707567782e6f72672f6265726e6172646f73696c76612f6769742d686f6f6b732d696e7374616c6c65722d706c7567696e2f642f6d6f6e74686c79)](https://packagist.org/packages/bernardosilva/git-hooks-installer-plugin)[![License](https://camo.githubusercontent.com/9f30aa0d59f2996b55cf5b7c7a1c330a5dab202c8e433d786ab1c2c2f83c93d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6265726e6172646f73696c76612f6769742d686f6f6b732d696e7374616c6c65722d706c7567696e2e737667)](https://packagist.org/packages/bernardosilva/git-hooks-installer-plugin)[![Build Status](https://camo.githubusercontent.com/20ed85f08aa51322bc885856cdc8dabd913840697d49a70a5939cf9dc99a1474/68747470733a2f2f7472617669732d63692e6f72672f4265726e6172646f53696c76612f6769742d686f6f6b732d696e7374616c6c65722d706c7567696e2e737667)](https://travis-ci.org/BernardoSilva/git-hooks-installer-plugin)[![Code Coverage](https://camo.githubusercontent.com/651e42d4823be532f601a43c99030db89c0a2652c188c9c73233314477ff4507/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4265726e6172646f53696c76612f6769742d686f6f6b732d696e7374616c6c65722d706c7567696e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/BernardoSilva/git-hooks-installer-plugin/?branch=master)

This project goal is to share and enforce code standards to all your projects.

Why create this?
----------------

[](#why-create-this)

Currently there are millions of php projects that do not follow or adapt any code standards.

I think the main reasons for that are:

- Lack of time to implement a script to check them;
- Not sure how those will help;
- Not sure how to enforce them for all team members;
- Not aware of what that is;

Using git-hook packages will enable everyone to share their hooks and reduce de number of projects not following any standards.

git-hook package
----------------

[](#git-hook-package)

A `git-hook` package is a composer package that uses the type `git-hook`.

Any package that set `git-hook-installer-plugin` as dependency and `type` to `git-hook`will be installed on your project using this plugin.

Git-hook packages available
---------------------------

[](#git-hook-packages-available)

Create you own git-hook package to be listed here and share it with everyone.

- [bernardosilva/git-hooks-php](https://packagist.org/packages/bernardosilva/git-hooks-php)
- [partnermarketing/pm-git-hooks-php](https://packagist.org/packages/partnermarketing/pm-git-hooks-php)

How to create my git-hook packages?
-----------------------------------

[](#how-to-create-my-git-hook-packages)

You can start by looking [into this example](https://github.com/BernardoSilva/git-hooks-php)

Things required to create a new git-hook package?

- `composer.json` file.
- The git hook files you want to use. [view list of available hooks](#available-hooks)

Example of new composer.json file

```
{
    "name": "yourname/your-package-name",
    "type": "git-hook",
    "description": "Composer git-hook package with hooks for your php projects.",
    "require": {
        "bernardosilva/git-hooks-installer-plugin": "^1.0.0"
    }
}
```

Note: Your `composer.json` must have a specific `type` to be installed in correct directory:

```
"type": "git-hook"

```

Also your git hooks should have execution permission.

#### Available hooks

[](#available-hooks)

You can create any of those files on your package with execute permissions.

- [applypatch-msg](https://git-scm.com/docs/githooks#_applypatch_msg)
- [pre-applypatch](https://git-scm.com/docs/githooks#_pre_applypatch)
- [pre-commit](https://git-scm.com/docs/githooks#_pre_commit)
- [prepare-commit-msg](https://git-scm.com/docs/githooks#_prepare_commit_msg)
- [commit-msg](https://git-scm.com/docs/githooks#_commit_msg)
- [pre-rebase](https://git-scm.com/docs/githooks#_pre_rebase)
- [pre-push](https://git-scm.com/docs/githooks#_pre_push)
- [update](https://git-scm.com/docs/githooks#update)
- [post-update](https://git-scm.com/docs/githooks#post-update)

[See a list of all git hooks available](https://git-scm.com/docs/githooks)

How to Install
--------------

[](#how-to-install)

```
php composer.phar require bernardosilva/git-hooks-installer-plugin
```

How to test
-----------

[](#how-to-test)

```
./vendor/bin/phpunit
```

How to contribute
-----------------

[](#how-to-contribute)

- Create your own git hook composer package.
- Create a PR to list your package on this page.
- Raise new issues or add suggestions to improve this plugin.

Created By
----------

[](#created-by)

[Bernardo Silva](https://www.bernardosilva.com)

License
-------

[](#license)

MIT © [Bernardo Silva](https://www.bernardosilva.com)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~98 days

Recently: every ~145 days

Total

9

Last Release

3079d ago

Major Versions

0.1.0 → 1.0.02016-05-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1537510?v=4)[Bernardo Vieira da Silva](/maintainers/BernardoSilva)[@BernardoSilva](https://github.com/BernardoSilva)

---

Top Contributors

[![BernardoSilva](https://avatars.githubusercontent.com/u/1537510?v=4)](https://github.com/BernardoSilva "BernardoSilva (36 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/bernardosilva-git-hooks-installer-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/bernardosilva-git-hooks-installer-plugin/health.svg)](https://phpackages.com/packages/bernardosilva-git-hooks-installer-plugin)
```

###  Alternatives

[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[vaimo/composer-changelogs

Provide information about package changes based on changelog files that are bundled with releases; provide tools for generating documentation files from changelog sources

11150.5k10](/packages/vaimo-composer-changelogs)[uma/composer-psysh

No-frills PsySH-Composer plugin

183.2k](/packages/uma-composer-psysh)

PHPackages © 2026

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