Skip to content

About

GrumPHP task running PhpDeprecationDetector (phpdd): catch PHP functions, constants and ini settings deprecated up to PHP 8.5 before they reach your repository.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

57 Commits

Folders and files

Repository files navigation

GrumPHP PhpDeprecationDetector (phpdd) task

CI Packagist License

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

Compatibility

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+

Installation

composer require --dev johnatas-x/grumphp-phpdd

Use the extension release matching your GrumPHP version, e.g. composer require --dev johnatas-x/grumphp-phpdd:~2.27.0 for GrumPHP 2.27.

Usage

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.

Maintenance

  • 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, tag x.y.0 once merged.

License

MIT, see LICENSE.

About

GrumPHP task running PhpDeprecationDetector (phpdd): catch PHP functions, constants and ini settings deprecated up to PHP 8.5 before they reach your repository.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages