Search by

amateescu / mago-drupal

amateescu

This package is abandoned and no longer maintained. The author suggests using the drupal/mago package instead.

Mago extension for Drupal. Linter rules and analyzer plugins that know the Drupal conventions.

Package info

github.com/amateescu/mago-drupal

pkg:composer/amateescu/mago-drupal

Statistics

Installs: 68

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

0.9.5 2026-11-12 12:22 UTC

This package is auto-updated.

Last update: 2026-11-13 15:54:02 UTC


README

Important

This project has moved to drupal.org as Mago for Drupal. The Composer package is now drupal/mago, and its namespace is DrupalMago\. Code, issues and releases are there; this repository is archived and doesn't get updates. The README below describes the last version released here, 0.9.5.

mago-drupal

A Mago extension that adds Drupal's coding standards to the Mago linter, and teaches the Mago analyzer what Drupal's services, entities, config and plugins hand back. With mago format and Mago's own rules, it replaces phpcs and Coder for the PHP files of a Drupal project. The parity target is Coder 9.

Quick start

PHP 8.1 or later and Mago 1.58 or later are required.

composer require --dev carthage-software/mago amateescu/mago-drupal

Then create mago.toml next to vendor/:

extends = "vendor/amateescu/mago-drupal/drupal.mago.toml"
# The lowest PHP version that the project supports.
php-version = "8.3"

For a Drupal core checkout, extend drupal-core.mago.toml instead. Then run the linter and the analyzer:

vendor/bin/mago lint
vendor/bin/mago analyze

Documentation

  • Setup: the install, what the config files set, the worker's arguments and the fix levels.
  • Linter rules: every rule, with what it reports, what its fix does, the section of Drupal's coding standards or the source checked by the rule, and the Coder checks ported by the rule.
  • Analyzer: what the drupal, phpunit and phpstan-ignores analyzer plugins type and report, and their limits.
  • Coming from Coder: every sniff of Coder's Drupal and DrupalPractice standards, and what takes its place.
  • Coming from PHPStan: every rule and extension of phpstan-drupal, the PHPStan identifiers reported by Mago too, how a phpstan.neon moves to Mago, and the issue codes that go with each PHPStan level.
  • Development: the checks, the test corpus and building the docs.

License

MIT.