drupal-check
Drupal code deprecation checker
TLDR
Check module for deprecations
SYNOPSIS
drupal-check [options] paths...
DESCRIPTION
drupal-check is a static analysis tool that checks Drupal code for deprecated API usage and other issues. It helps prepare modules for Drupal version upgrades by identifying code that needs updating.
The tool uses PHPStan for static analysis with Drupal-specific rules. It detects usage of deprecated functions, classes, and services that will be removed in future Drupal versions.
drupal-check is essential for maintaining Drupal modules and ensuring compatibility with upcoming releases.
PARAMETERS
PATHS
Directories or files to analyze.-a, --analysis
Run full analysis (not just deprecations).--drupal-root PATH
Drupal installation root.--format FORMAT
Output format: table, json, junit.-e, --exclude-dir DIR
Directories to exclude.-n, --no-progress
Disable progress bar.--help
Display help information.
CAVEATS
Requires PHP and Composer. May have false positives. Complex dynamic code may not analyze correctly. Results depend on deprecation database currency.
HISTORY
drupal-check was created by Matt Glaman to help the Drupal community prepare for Drupal 9 migration. It addresses the challenge of identifying deprecated code across large Drupal codebases.
