PHPackages                             drupol/php-conventions - 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. drupol/php-conventions

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

drupol/php-conventions
======================

PHP conventions based on GrumPHP.

6.0.5(1y ago)7131.8k—3.3%120MITPHPPHP &gt;= 8.2

Since Aug 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/drupol/php-conventions)[ Packagist](https://packagist.org/packages/drupol/php-conventions)[ GitHub Sponsors](https://github.com/drupol)[ RSS](/packages/drupol-php-conventions/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (11)Versions (43)Used By (20)

[![Latest Stable Version](https://camo.githubusercontent.com/7ef2affd6276780a0af4201ee6a9f64dc9c55ed3e1293464d30aca28136aad82/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f647275706f6c2f7068702d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/php-conventions)[![GitHub stars](https://camo.githubusercontent.com/53b92dc8d6134fdbbeac8bf8b54e4b8f26d50c21598baa0441c68f18196bc272/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f647275706f6c2f7068702d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/php-conventions) [![Total Downloads](https://camo.githubusercontent.com/f61981ae9c42fd9e4d105712eebc586ba12c17fbbd48b36cd0ba66ba9c666192/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f647275706f6c2f7068702d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/php-conventions)[![License](https://camo.githubusercontent.com/a3de2bd75ada0e5fbbb0e24adbc47c3ce3ff76df2777b0009724efa6be18c903/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f647275706f6c2f7068702d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/php-conventions)

PHP conventions
===============

[](#php-conventions)

Description
-----------

[](#description)

A developer tool which provides a pre-defined [GrumPHP](https://packagist.org/packages/grumphp/grumphp) configuration tailored specifically for PHP development.

Features
--------

[](#features)

The default [GrumPHP](https://packagist.org/packages/grumphp/grumphp) configuration ships with the following checks:

- [License file](https://packagist.org/packages/loophp/grumphp-license-task) creation,
- [Composer Require Checker](https://packagist.org/packages/maglnet/composer-require-checker),
- `composer.json` validation,
- [composer.json normalization](https://packagist.org/packages/ergebnis/composer-normalize),
- YAML Lint,
- JSON Lint,
- [PHP Lint](https://packagist.org/packages/php-parallel-lint/php-parallel-lint),
- [Twig CS](https://packagist.org/packages/friendsoftwig/twigcs),
- [PHP CS Fixer](https://packagist.org/packages/FriendsOfPHP/PHP-CS-Fixer) checks (*Based on [PSR12](https://www.php-fig.org/psr/psr-12/)*),
- [PHP CS](https://packagist.org/packages/squizlabs/php_codesniffer),
- [PHPStan](https://packagist.org/packages/phpstan/phpstan).
- [PSalm](https://github.com/drupol/php-conventions/issues),

It provides a default configuration for each task, and they are customizable at will through a simple YAML configuration file.

Tasks can be also added or skipped according to your need.

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

[](#installation)

```
composer require drupol/php-conventions --dev
```

### If you're not using GrumPHP

[](#if-youre-not-using-grumphp)

Manually add to your `composer.json` file

```
"extra":
  {
    "grumphp":
      {
        "config-default-path": "vendor/drupol/php-conventions/config/php73/grumphp.yml",
      },
  }
```

Replace the string `php73` with the minimal version of PHP you want to support.

Current choices are:

- `psr12`

### If you're using GrumPHP already

[](#if-youre-using-grumphp-already)

Edit the file `grumphp.yml.dist` or `grumphp.yml` and add on the top it:

```
imports:
  - { resource: vendor/drupol/php-conventions/config/php73/grumphp.yml }
```

To add an extra GrumPHP task:

```
imports:
  - { resource: vendor/drupol/php-conventions/config/php73/grumphp.yml }

parameters:
  extra_tasks:
    infection:
      threads: 1
      test_framework: phpspec
      configuration: infection.json.dist
      min_msi: 60
      min_covered_msi: 60
  skip_tasks:
    - phpcsfixer
```

In conjunction with `extra_tasks`, use `skip_tasks` to skip tasks if needed.

Usage
-----

[](#usage)

Basic usage
-----------

[](#basic-usage)

```
vendor/bin/grumphp run
```

This will run all the pre-configured tasks.

### Advanced usage

[](#advanced-usage)

If you're willing to specify a group of tasks only, you can use the pre-defined test suites.

Available test-suites are:

- `cs`
    - license
    - composer
    - composer\_normalize
    - yamllint
    - jsonlint
    - phplint
    - twigcs
    - phpcsfixer
- `static-analysis`
    - phpstan
    - psalm

To run a particular test-suite:

```
vendor/bin/grumphp run --testsuite=cs
```

To run particular tasks:

```
vendor/bin/grumphp run --tasks=phpcsfixer,phpstan
```

Contributing
------------

[](#contributing)

Report bug on the [issue tracker](https://github.com/drupol/php-conventions/issues).

See the file [CONTRIBUTING.md](https://github.com/drupol/php-conventions/blob/master/.github/CONTRIBUTING.md) but feel free to contribute to this library by sending Github pull requests.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](https://github.com/drupol/php-conventions/blob/master/CHANGELOG.md) for a changelog based on [git commits](https://github.com/drupol/php-conventions/commits/master).

For more detailed changelogs, please check [the release changelogs](https://github.com/drupol/php-conventions/releases).

To generate the changelog, use the following command:

```
docker-compose run auto_changelog  --commit-limit false --hide-credit --sort-commits date-desc --breaking-pattern ""BREAKING CHANGE: yes" --template keepachangelog -u
```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance41

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

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

Recently: every ~0 days

Total

42

Last Release

492d ago

Major Versions

2.0.4 → 3.0.02020-12-17

1.8.20 → 3.0.22021-02-09

3.0.3 → 4.0.02021-04-21

4.0.4 → 5.0.02021-05-07

5.1.4 → 6.0.02024-10-09

PHP version history (8 changes)1.7.4PHP &gt;= 7.1.3

1.8.17PHP &gt;= 7.2.3

2.0.0PHP &gt;= 7.3

2.0.4PHP ^7.3 || ^7.4

3.0.0PHP ^7.3 || ^7.4 || ^8

4.0.0PHP &gt;= 7.4

6.0.0PHP &gt;= 8.1

6.0.1PHP &gt;= 8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/252042?v=4)[Pol Dellaiera](/maintainers/drupol)[@drupol](https://github.com/drupol)

---

Top Contributors

[![drupol](https://avatars.githubusercontent.com/u/252042?v=4)](https://github.com/drupol "drupol (150 commits)")

### Embed Badge

![Health badge](/badges/drupol-php-conventions/health.svg)

```
[![Health](https://phpackages.com/badges/drupol-php-conventions/health.svg)](https://phpackages.com/packages/drupol-php-conventions)
```

###  Alternatives

[wp-cli/wp-cli-tests

WP-CLI testing framework

423.0M129](/packages/wp-cli-wp-cli-tests)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20830.6M166](/packages/mglaman-phpstan-drupal)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k44](/packages/friendsoftypo3-content-blocks)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

39250.0k28](/packages/ec-europa-toolkit)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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