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

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xwillq/captains-hooks
=====================

Additional hooks for CaptainHook

1.1.0(3y ago)1557[1 PRs](https://github.com/xwillq/captains-hooks/pulls)MITPHPPHP ^8.0

Since Sep 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/xwillq/captains-hooks)[ Packagist](https://packagist.org/packages/xwillq/captains-hooks)[ Docs](https://github.com/xwillq/captains-hooks)[ RSS](/packages/xwillq-captains-hooks/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (5)Used By (0)

Captain's Hooks
===============

[](#captains-hooks)

My hooks for [Captain Hook](https://github.com/captainhookphp/captainhook).

Installation
------------

[](#installation)

Install with Composer:

```
composer require --dev xwillq/captains-hooks
```

Available hooks
---------------

[](#available-hooks)

### FormatPHPFilesInCommit

[](#formatphpfilesincommit)

Runs code formatter before commit, only formats changes that were staged and applies fixes to working tree. Uses Laravel [Pint](https://github.com/laravel/pint)by default.

Can be used only as `pre-commit` hook. Configuration:

```
{
    "action": "\\Xwillq\\Hooks\\Hooks\\FormatPHPFilesInCommit",
    "options": {
        // Exclude files from formatting.
        "excluded-files": [
            // Specify file path.
            "src/FormatPHPFilesInCommit.php",
            // Patterns starting with / are treated as a regex.
            "/tests\/.*/",
            // Glob pattern.
            "config/*"
        ],
        // Command to execute. Placeholder `{}` gets replaced with path to file.
        // `vendor/bin/pint {}` is the default value.
        "formatter": "vendor/bin/pint {}"
    }
}
```

### FixPHPStormMergeMessage

[](#fixphpstormmergemessage)

When merging, PHPStorm adds list of conflicts to commit message body as comments. This hook removes them.

Can be used only as `prepare-commit-msg` hook. Configuration:

```
{
    "action": "\\Xwillq\\Hooks\\Hooks\\FixPHPStormMergeMessage"
}
```

### RemoveCommentsFromCommitMessage

[](#removecommentsfromcommitmessage)

Removes comments from commit message. Can be used to sanitize message before validation.

Can be used as `pre-commit`, `prepare-commit-msg` and `commit-msg` hook. Configuration:

```
{
    "action": "\\Xwillq\\Hooks\\Hooks\\RemoveCommentsFromCommitMessage"
}
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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 ~0 days

Total

3

Last Release

1398d ago

### Community

Maintainers

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

---

Top Contributors

[![xwillq](https://avatars.githubusercontent.com/u/38136135?v=4)](https://github.com/xwillq "xwillq (5 commits)")

---

Tags

githookscaptainhook

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/xwillq-captains-hooks/health.svg)

```
[![Health](https://phpackages.com/badges/xwillq-captains-hooks/health.svg)](https://phpackages.com/packages/xwillq-captains-hooks)
```

###  Alternatives

[ramsey/conventional-commits

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

1931.6M155](/packages/ramsey-conventional-commits)[wcm/git-php-hooks

Write git hooks with PHP, organize them on a per-project base and automatically add them

6442.5k3](/packages/wcm-git-php-hooks)[felipebool/crook

Crook is a simple tool to ease your life when dealing with git hooks

5913.9k](/packages/felipebool-crook)[bernardosilva/git-hooks-php

Composer git-hook package with hooks for your php projects.

2516.7k1](/packages/bernardosilva-git-hooks-php)[wcm/git-php-hooks-library

A collection of Git PHP Hooks

1210.2k3](/packages/wcm-git-php-hooks-library)

PHPackages © 2026

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