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

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

ecphp/php-conventions
=====================

ECPHP PHP conventions.

1.0.3(1y ago)123.5k↓41.7%110BSD-3-ClausePHPPHP &gt;= 7.4

Since May 10Pushed 1y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (5)Used By (10)

[![Latest Stable Version](https://camo.githubusercontent.com/ebe9670cfdd62a8898989976909e3c97f8ab94369846b218abe4a74e37e0284b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65637068702f7068702d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ecphp/php-conventions)[![GitHub stars](https://camo.githubusercontent.com/36aa980c0fb8b8daa4a63d0d33250f8b12f635310453bdb4328343daa22d1e54/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f65637068702f7068702d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ecphp/php-conventions)[![Total Downloads](https://camo.githubusercontent.com/411c8fe6bd967608af385452acc5a9585cb9db966b78ff4f8751cf8a978e4a2f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65637068702f7068702d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ecphp/php-conventions)[![License](https://camo.githubusercontent.com/37e4dbf4dd4786d6121325030dd1c71803f528ec793de723875c0270998b6861/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f65637068702f7068702d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ecphp/php-conventions)

ECPHP PHP conventions
=====================

[](#ecphp-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 at [European Commission](https://ec.europa.eu).

This package has been inspired by [drupol/php-conventions](https://packagist.org/packages/drupol/php-conventions) and [ergebnis/php-library-template](https://packagist.org/packages/ergebnis/php-library-template).

Features
--------

[](#features)

Based on [GrumPHP](https://packagist.org/packages/grumphp/grumphp), this tool will run a set of quality control tools via a git hook. The user is free to disable the git hook and run the tool manually instead, see the [documentation](https://github.com/phpro/grumphp/blob/master/doc/commands.md) to know more about that.

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

- [License file](https://packagist.org/packages/ergebnis/license) creation (*BSD-3-Clause by default*),
- [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://packagist.org/packages/vimeo/psalm).

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 needs.

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

[](#installation)

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

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

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

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

Current choices are:

- `psr12`
- `php73`
- `php74` (*Not available yet*)

You may configure everything from that file.

To add an extra task or skip a task:

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

parameters:
  extra_tasks:
    phpunit: ~
  skip_tasks:
    - phpstan
```

To edit the configuration of a particular existing task

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

parameters:
  tasks.license.holder:
  tasks.license.name: BSD-3-Clause # MIT and EUPL-1.2 are also available
  tasks.license.date_from: 2019
```

Find all the available customizable properties in the imported file on the top of the YAML file.

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\_require\_checker
    - composer
    - composer\_normalize
    - yamllint
    - jsonlint
    - phplint
    - twigcs
    - phpcsfixer
    - phpcs
- `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,phpcs
```

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

[](#contributing)

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

See the file [CONTRIBUTING.md](https://github.com/ecphp/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/ecphp/php-conventions/blob/master/CHANGELOG.md) for a changelog based on [git commits](https://github.com/ecphp/php-conventions/commits/master).

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance45

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community18

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

Total

4

Last Release

424d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/96d984045c84130d019f84c8942418fa1e4966fb9705b859922b5c2071b526eb?d=identicon)[ecphp](/maintainers/ecphp)

---

Top Contributors

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

---

Tags

code-stylegrumphpphp-conventions

### Embed Badge

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

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

###  Alternatives

[drupol/drupal-conventions

Drupal conventions for coding.

2422.7k1](/packages/drupol-drupal-conventions)

PHPackages © 2026

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