A GrumPHP task running PhpDeprecationDetector (phpdd) on your changed files: it fails when your code uses functions, constants, variables or ini directives deprecated or removed in the target PHP version (5.3 → 8.5).
This extension follows GrumPHP's versions: release x.y.z targets GrumPHP x.y (since 2.27.2, any x.y.* patch release of GrumPHP).
| Extension | GrumPHP | PHP |
|---|---|---|
2.27.* |
2.27.* |
8.2 – 8.6 |
2.17.* → 2.26.* |
same minor | 8.2+ |
2.9.* → 2.16.* |
same minor | 8.1+ |
1.* |
1.* |
7.4+ |
composer require --dev johnatas-x/grumphp-phpddUse the extension release matching your GrumPHP version, e.g. composer require --dev johnatas-x/grumphp-phpdd:~2.27.0 for GrumPHP 2.27.
Register the extension and configure the task in your grumphp.yml:
grumphp:
extensions:
- GrumphpPhpdd\ExtensionLoader
tasks:
phpdd:
files: [ web/modules/custom, web/themes/custom ]
target: '8.4'
after: '8.1'
exclude: [ vendor ]
max_size: 1mb
file_extensions: [ php, module, inc, install, theme ]
skip_checks: [ ]| Option | Type | Default | Description |
|---|---|---|---|
files |
array | [] (all files) |
Only check the changed files under these paths. |
target |
string | '' (phpdd: latest) |
Target PHP version, 5.3 → 8.5 (PHP 8.2+ targets need phpdd 1.5+). |
after |
string | '' (phpdd: 5.3) |
Initial PHP version for checks: skip older ones. |
exclude |
array | [] |
File or directory names to exclude. |
max_size |
string | '' (phpdd: 1mb) |
Skip files larger than this size (fixed in 2.27.2). |
file_extensions |
array | [php, php5, phtml] |
File extensions to check. |
skip_checks |
array | [] |
Skip the checks containing any of these values. |
phpdd detects deprecations by name. For a complete compatibility check, also use PHPCompatibility.
- Dependencies are updated by Renovate and automerged when CI passes.
- CI installs the extension in a temporary project on each supported PHP version and checks that the task passes on
clean code and fails on bad code (
tests/smoke.sh). - When Renovate bumps GrumPHP to a new minor version
x.y, tagx.y.0once merged.
MIT, see LICENSE.