PHPackages                             phpro/grumphp - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. phpro/grumphp

ActiveComposer-plugin[Testing &amp; Quality](/categories/testing)

phpro/grumphp
=============

A composer plugin that enables source code quality checks.

v2.19.0(3mo ago)4.3k15.5M—9.6%447[6 issues](https://github.com/phpro/grumphp/issues)[2 PRs](https://github.com/phpro/grumphp/pulls)20MITPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Mar 18Pushed 1mo ago70 watchersCompare

[ Source](https://github.com/phpro/grumphp)[ Packagist](https://packagist.org/packages/phpro/grumphp)[ RSS](/packages/phpro-grumphp/feed)WikiDiscussions v2.x Synced 1mo ago

READMEChangelog (10)Dependencies (30)Versions (114)Used By (20)

[![Github Actions](https://github.com/phpro/grumphp/workflows/GrumPHP/badge.svg?branch=master)](https://github.com/phpro/grumphp/actions/workflows/grumphp.yml)[![AppVeyor](https://camo.githubusercontent.com/72841147b570431a0721c901a2f679f7b122565b8f504fdf7b34711139114016/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f74746c62617532736a673336657030312f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/veewee/grumphp/branch/master)[![Installs](https://camo.githubusercontent.com/fcfc8c6560b6b537c2e704f495b8a12432846fdd1ad21aaa9a86f44c793032ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706870726f2f6772756d7068702e737667)](https://packagist.org/packages/phpro/grumphp/stats)[![Packagist](https://camo.githubusercontent.com/bda5683ca58abbcda0eb1f2004ebb1f7777b02b94acbe700b3e4bca66b759ed6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706870726f2f6772756d7068702e737667)](https://packagist.org/packages/phpro/grumphp)

[![Twitter](https://camo.githubusercontent.com/3ad7806e46497f7175017013c2054020c1ff23c522ee6914121b70f79fdfb465/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f547769747465722d2534306772756d7068702d626c75652e737667)](https://twitter.com/intent/user?screen_name=grumphp)[![Join the chat at https://gitter.im/phpro/grumphp](https://camo.githubusercontent.com/c897d5cc6adeaf4b50595345af6c8fa1c5a54e6cec87473068f060b4f211eae7/68747470733a2f2f6261646765732e6769747465722e696d2f706870726f2f6772756d7068702e737667)](https://gitter.im/phpro/grumphp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

GrumPHP
=======

[](#grumphp)

[![](https://raw.githubusercontent.com/phpro/grumphp/master/resources/logo/grumphp-grumpy.png)](https://raw.githubusercontent.com/phpro/grumphp/master/resources/logo/grumphp-grumpy.png)

Sick and tired of defending code quality over and over again? GrumPHP will do it for you! This composer plugin will register some git hooks in your package repository. When somebody commits changes, GrumPHP will run some tests on the committed code. If the tests fail, you won't be able to commit your changes. This handy tool will not only improve your codebase, it will also teach your co-workers to write better code following the best practices you've determined as a team.

GrumPHP has a set of common tasks built-in. You will be able to use GrumPHP with a minimum of configuration.

We don't want to bore you with all the details, so quick: install it yourself and unleash the power of GrumPHP!

Demo
----

[](#demo)

[![demo](https://github.com/phpro/grumphp/wiki/images/demo.gif)](https://github.com/phpro/grumphp/wiki/images/demo.gif)

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

[](#installation)

In order for this package to work, you have to make sure following tools are discoverable on the command-line:

- php
- composer
- git

This package is a composer plugin and should be installed to your project's dev dependency using composer:

Install GrumPHP as a phar without dependencies:

```
composer require --dev phpro/grumphp-shim
```

Install GrumPHP with dependencies:

```
composer require --dev phpro/grumphp

```

Install GrumPHP without dependencies and automated git hooks through phive

```
phive install grumphp

```

When the package is installed, GrumPHP will attach itself to the git hooks of your project. You will see following message in the composer logs:

*Watch out! GrumPHP is sniffing your commits!*

GrumPHP will never push you into using a specific task. You can choose the tasks that fit your needs, and activate or deactivate any task in no time! See the `suggest` section in [composer.json](https://github.com/phpro/grumphp/blob/master/composer.json#L50).

Note: GrumPHP will overwrite existing hooks unless you run `composer install` with `--no-plugins` or `--no-scripts`. We do create a backup of your git hook, but it's best to make sure you also have a backup of your custom hooks before you try to install GrumPHP.

Having trouble installing GrumPHP? Find out how to:

- [Install globally](doc/installation/global.md)
- [Install with an exotic project structure](doc/installation/exotic.md)

Configuration
-------------

[](#configuration)

Some things in GrumPHP can be configured in a `grumphp.yml` or `grumphp.yml.dist` or `grumphp.dist.yml` file in the root of your project (the directory where you run the grumphp command). You can specify a custom config filename and location in `composer.json` or in the `--config` option of the console commands.

```
# grumphp.yml
grumphp:
    hooks_dir: ~
    hooks_preset: local
    git_hook_variables:
        VAGRANT_HOST_DIR: .
        VAGRANT_PROJECT_DIR: /var/www
        EXEC_GRUMPHP_COMMAND: exec
        ENV: {}
    stop_on_failure: false
    ignore_unstaged_changes: false
    hide_circumvention_tip: false
    process_timeout: 60
    ascii:
        failed: grumphp-grumpy.txt
        succeeded: grumphp-happy.txt
    parallel:
        enabled: true
        max_workers: 32
    fixer:
        enabled: true
        fix_by_default: false
    environment:
        files: []
        variables: {}
        paths: []
    tasks: {}
    testsuites: []
    extensions: []
```

Details of the configuration are broken down into the following sections.

- [Parameters](doc/parameters.md) – Configuration settings for GrumPHP itself.
- [Tasks](doc/tasks.md) – External tasks performing code validation and their respective configurations.
- [TestSuites](doc/testsuites.md)
- [Extensions](doc/extensions.md)
- [Extending the TaskRunner](doc/runner.md)
- [Conventions checker](doc/conventions.md)

Commands
--------

[](#commands)

Since GrumPHP is just a CLI tool, these commands can be triggered:

- [configure](doc/commands.md#installation)
- [git:init](doc/commands.md#installation)
- [git:deinit](doc/commands.md#installation)
- [git:pre-commit](doc/commands.md#git-hooks)
- [git:commit-msg](doc/commands.md#git-hooks)
- [run](doc/commands.md#run)

Compatibility
-------------

[](#compatibility)

GrumPHP works with PHP 5.6 or above.

This package has been tested with following git clients:

- CLI Unix
- CLI Mac
- CLI Windows
- PhpStorm Git
- Atlassian SourceTree
- Syntevo SmartGit

Roadmap
-------

[](#roadmap)

Lots of tasks are already available to make sure your team writes great code. We are always looking to support new tasks. Feel free to log an issue or create a pull request for a task we forgot.

Are you missing a feature or did you find a bug? Log it in the [issue tracker](https://github.com/phpro/grumphp/issues)! Want to help out? Feel free to contact us!

FAQ
---

[](#faq)

- [FAQ](doc/faq.md)

About
-----

[](#about)

### Submitting bugs and feature requests

[](#submitting-bugs-and-feature-requests)

Bugs and feature request are tracked on [GitHub](https://github.com/phpro/grumphp/issues). Please take a look at our rules before [contributing your code](CONTRIBUTING.md).

### License

[](#license)

GrumPHP is licensed under the [MIT License](LICENSE).

###  Health Score

82

—

ExcellentBetter than 100% of packages

Maintenance85

Actively maintained with recent releases

Popularity77

Solid adoption and visibility

Community60

Healthy contributor diversity

Maturity97

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 73% 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 ~36 days

Recently: every ~28 days

Total

111

Last Release

104d ago

Major Versions

v0.22.0 → v1.0.02020-09-25

v1.x-dev → v2.0.0-beta12023-05-26

PHP version history (14 changes)v0.1.0PHP &gt;=5.3

v0.2.0PHP &gt;=5.3.6

v0.10.0PHP &gt;=5.6.0

v0.15.0PHP &gt;=7.0

v0.16.0PHP ^7.1

v0.17.0PHP ^7.2

v0.20.0PHP ^7.3

v1.2.0PHP ^7.3 || ^8.0

v1.6.0PHP ^8.0

v1.11.0PHP ^7.4 || ^8.0

v2.0.0-beta1PHP ^8.1

v2.3.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0

v2.9.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

v2.17.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

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

---

Top Contributors

[![veewee](https://avatars.githubusercontent.com/u/1618158?v=4)](https://github.com/veewee "veewee (1212 commits)")[![Landerstraeten](https://avatars.githubusercontent.com/u/5587595?v=4)](https://github.com/Landerstraeten "Landerstraeten (67 commits)")[![Bilge](https://avatars.githubusercontent.com/u/470626?v=4)](https://github.com/Bilge "Bilge (30 commits)")[![Kanti](https://avatars.githubusercontent.com/u/471387?v=4)](https://github.com/Kanti "Kanti (30 commits)")[![UrGuardian4ngel](https://avatars.githubusercontent.com/u/3755487?v=4)](https://github.com/UrGuardian4ngel "UrGuardian4ngel (27 commits)")[![jyggen](https://avatars.githubusercontent.com/u/264300?v=4)](https://github.com/jyggen "jyggen (23 commits)")[![aderuwe](https://avatars.githubusercontent.com/u/1125184?v=4)](https://github.com/aderuwe "aderuwe (20 commits)")[![aaa2000](https://avatars.githubusercontent.com/u/163941?v=4)](https://github.com/aaa2000 "aaa2000 (20 commits)")[![oallain](https://avatars.githubusercontent.com/u/6593252?v=4)](https://github.com/oallain "oallain (19 commits)")[![igormukhingmailcom](https://avatars.githubusercontent.com/u/6544038?v=4)](https://github.com/igormukhingmailcom "igormukhingmailcom (14 commits)")[![cafferata](https://avatars.githubusercontent.com/u/1150425?v=4)](https://github.com/cafferata "cafferata (13 commits)")[![JTubex](https://avatars.githubusercontent.com/u/5894935?v=4)](https://github.com/JTubex "JTubex (13 commits)")[![mgeoffray](https://avatars.githubusercontent.com/u/1154299?v=4)](https://github.com/mgeoffray "mgeoffray (13 commits)")[![poppabear8883](https://avatars.githubusercontent.com/u/7263458?v=4)](https://github.com/poppabear8883 "poppabear8883 (13 commits)")[![tombevers](https://avatars.githubusercontent.com/u/145226?v=4)](https://github.com/tombevers "tombevers (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (11 commits)")[![delboy1978uk](https://avatars.githubusercontent.com/u/2684575?v=4)](https://github.com/delboy1978uk "delboy1978uk (11 commits)")[![bortefi](https://avatars.githubusercontent.com/u/44976351?v=4)](https://github.com/bortefi "bortefi (11 commits)")[![yguedidi](https://avatars.githubusercontent.com/u/1480128?v=4)](https://github.com/yguedidi "yguedidi (11 commits)")[![joestewart](https://avatars.githubusercontent.com/u/107414?v=4)](https://github.com/joestewart "joestewart (9 commits)")

---

Tags

code-qualitycomposer-plugingit-hookshacktoberfestphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpro-grumphp/health.svg)

```
[![Health](https://phpackages.com/badges/phpro-grumphp/health.svg)](https://phpackages.com/packages/phpro-grumphp)
```

###  Alternatives

[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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