PHPackages                             fp-coding-standards/git-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. fp-coding-standards/git-hooks

ActiveLibrary

fp-coding-standards/git-hooks
=============================

php git commit hooks

v1.0.0(10y ago)25MITPHP

Since Apr 21Pushed 10y ago1 watchersCompare

[ Source](https://github.com/bupt1987/git-hooks)[ Packagist](https://packagist.org/packages/fp-coding-standards/git-hooks)[ RSS](/packages/fp-coding-standards-git-hooks/feed)WikiDiscussions master Synced 1mo ago

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

Git Hooks
=========

[](#git-hooks)

[![Total Downloads](https://camo.githubusercontent.com/5ea800f7a1f4b44b0a5f01fabb8528910db2305c8ea778aceba4bca9242469da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f776e6c6f6164732d392e356b2d677265656e2e737667)](https://packagist.org/packages/fp-coding-standards/git-hooks)

依赖
==

[](#依赖)

```
composer require fp-coding-standards/fpcs

```

功能简述
====

[](#功能简述)

1、在提交代码（git commit）到git库时，本钩子被触发。
2、调用phpcbf和phpcs，来做代码检查并尝试自动修复代码样式。
3、将修复后的代码提交到git库中。

安装步骤
====

[](#安装步骤)

1、安装依赖PHP\_CodeSniffer，定义代码样式，本例中使用[FunPlus-Coding-Standards](https://github.com/funplus/FunPlus-Coding-Standards)。
2、安装钩子 ` vendor/bin/git-hooks-install`

参考
==

[](#参考)

### 1. git钩子

[](#1-git钩子)

参考 [Git Hook](http://githooks.com/) 或自行Google

### 2.代码检查

[](#2代码检查)

本钩子使用[PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)做代码检查，需要提前配置好PHP\_CodeSniffer和PHP\_CodeSniffer所需的rule set。

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3670d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49199117b5b3fe03975acc908ade55d39d92775cfc6145682127d889cd82fd8c?d=identicon)[bupt1987](/maintainers/bupt1987)

---

Top Contributors

[![bupt1987](https://avatars.githubusercontent.com/u/1306979?v=4)](https://github.com/bupt1987 "bupt1987 (22 commits)")

---

Tags

gitgit-hooks

### Embed Badge

![Health badge](/badges/fp-coding-standards-git-hooks/health.svg)

```
[![Health](https://phpackages.com/badges/fp-coding-standards-git-hooks/health.svg)](https://phpackages.com/packages/fp-coding-standards-git-hooks)
```

###  Alternatives

[brainmaestro/composer-git-hooks

Easily manage git hooks in your composer config

1.1k9.1M442](/packages/brainmaestro-composer-git-hooks)[captainhook/captainhook

PHP git hook manager

1.1k6.8M365](/packages/captainhook-captainhook)[czproject/git-php

Library for work with Git repository in PHP.

5544.9M79](/packages/czproject-git-php)[cypresslab/gitelephant

An abstraction layer for git written in PHP

6131.0M23](/packages/cypresslab-gitelephant)[marcocesarato/php-conventional-changelog

Generate changelogs and release notes from a project's commit messages and metadata and automate versioning with semver.org and conventionalcommits.org

2511.3M107](/packages/marcocesarato-php-conventional-changelog)[ramsey/conventional-commits

A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook action!

1931.2M120](/packages/ramsey-conventional-commits)

PHPackages © 2026

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