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

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

drupol/drupal-conventions
=========================

Drupal conventions for coding.

2.0.1(4y ago)2422.7k2[1 PRs](https://github.com/drupol/drupal-conventions/pulls)1MITPHPPHP &gt;= 7.4

Since Feb 1Pushed 4y ago2 watchersCompare

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

READMEChangelogDependencies (3)Versions (18)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/2538f54719561bbc6eb96cd7aea9c437846916c9d2fb243a6fcde126777c6630/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f647275706f6c2f64727570616c2d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/drupal-conventions)[![Stars](https://camo.githubusercontent.com/7f6cf79554a00b86bdd2c1d8c8ea74f6f5ae859cdf136b0409b1aa29d7390a2d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f647275706f6c2f64727570616c2d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://github.com/drupol/drupal-conventions)[![Total Downloads](https://camo.githubusercontent.com/645e8e58d96a598c2c8bbc0742dfff0aadeff8a27bd315e0c1249e96ef229e0d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f647275706f6c2f64727570616c2d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/drupal-conventions)[![Build Status](https://camo.githubusercontent.com/166a09d8b21058fdf25bf2bef4414c26c7ac3359f9347ddafebb22f961445f19/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f647275706f6c2f64727570616c2d636f6e76656e74696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/drupol/drupal-conventions)[![License](https://camo.githubusercontent.com/f9fce9b6c938e38aa9bebaf60e5fde69dba90f0051d78ff5faf0f2addcbbd116/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f647275706f6c2f64727570616c2d636f6e76656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drupol/drupal-conventions)[![Say Thanks!](https://camo.githubusercontent.com/05c3c1ff30c669596f087c84fa3128739d9a3c5ba0d3537ed0e41ad41553a04e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5361792d7468616e6b732d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://saythanks.io/to/drupol)[![Donate!](https://camo.githubusercontent.com/f2e288c194c16198351c80fcb396a39afb2ae2ccf89c1549c8dc049901151137/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617970616c2d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://paypal.me/drupol)

Drupal conventions
==================

[](#drupal-conventions)

This tool will check your code against Drupal's coding standard.

It's based on [GrumPHP](https://github.com/phpro/grumphp) and comes with a default configuration tailored for Drupal development.

The following checks are triggered:

- [Drupal coder](https://www.drupal.org/project/coder) code sniffer's checks
- Custom [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) configuration
- PHPLint
- YAMLlint
- JSONlint

Drupal 7 and 8 are supported.

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

[](#installation)

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

### If you're not using GrumPHP

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

Manually add to your `composer.json` file:

#### Drupal 8

[](#drupal-8)

```
    "extra": {
        "grumphp": {
            "config-default-path": "vendor/drupol/drupal-conventions/config/drupal8/grumphp.yml"
        }
    }
```

#### Drupal 7

[](#drupal-7)

```
    "extra": {
        "grumphp": {
            "config-default-path": "vendor/drupol/drupal-conventions/config/drupal7/grumphp.yml"
        }
    }
```

### 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:

#### Drupal 8

[](#drupal-8-1)

```
imports:
  - { resource: vendor/drupol/drupal-conventions/config/drupal8/grumphp.yml }
```

#### Drupal 7

[](#drupal-7-1)

```
imports:
  - { resource: vendor/drupol/drupal-conventions/config/drupal7/grumphp.yml }
```

To add an extra Grumphp task:

```
imports:
  - { resource: vendor/drupol/drupal-conventions/config/drupal7/grumphp.yml }

parameters:
  extra_tasks:
    phpunit:
      always_execute: false
```

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

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

[](#contributing)

Feel free to contribute to this library by sending Github pull requests. I'm quite reactive :-)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

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

Every ~43 days

Recently: every ~71 days

Total

15

Last Release

1812d ago

Major Versions

1.7.x-dev → 2.0.02021-05-12

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

1.7.4.2PHP ^5.6

2.0.0PHP &gt;= 7.4

### 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 (111 commits)")

---

Tags

phpcsdrupalphp-cs-fixerCoding Standardcoding-style

### Embed Badge

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

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

###  Alternatives

[phpcsstandards/phpcsutils

A suite of utility functions for use with PHP\_CodeSniffer

6333.4M58](/packages/phpcsstandards-phpcsutils)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[woocommerce/woocommerce-sniffs

WooCommerce sniffs

496.8M42](/packages/woocommerce-woocommerce-sniffs)[typo3/coding-standards

A set of coding guidelines for any TYPO3-related project or extension

662.8M379](/packages/typo3-coding-standards)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[phpcompatibility/phpcompatibility-paragonie

A set of rulesets for PHP\_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.

1031.3M10](/packages/phpcompatibility-phpcompatibility-paragonie)

PHPackages © 2026

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