Skip to content
Check Drupal code for deprecations and discover bugs via static analysis
Branch: master
Clone or download
Latest commit 1057dd6 Mar 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
phpstan
src Use jean85/pretty-package-versions for fancy version Mar 4, 2019
.editorconfig Initial commit Feb 14, 2019
.gitignore Try to implement better deployment of the phar (#13) Mar 21, 2019
.travis.yml Try to implement better deployment of the phar (#13) Mar 21, 2019
README.md
box.json
composer.json Mark the requirement of PHP > 7.1 Mar 20, 2019
composer.lock
drupal-check Mark the requirement of PHP > 7.1 Mar 20, 2019
stub.php Initial commit Feb 14, 2019

README.md

drupal-check Build Status Latest release

Requirements

You must have PHP 7.1 or greater, which is a requirement of PHPStan, the static analyzer backing this tool.

Usage

For the best experience with this tool is best used against a vanilla Drupal project. It will work against custom Drupal projects, but there can be conflicts against other development tools added to projects.

Check deprecations

# Example: Against address contrib
drupal-check /path/to/drupal8/modules/contrib/address
drupal-check -d /path/to/drupal8/modules/contrib/address

Check static analysis

# Example: Against address contrib
drupal-check -a /path/to/drupal8/modules/contrib/address

Check static analysis and deprecations

# Example: Against address contrib
drupal-check -ad /path/to/drupal8/modules/contrib/address

Coming soon: code style w/ phpcs integration.

Install

Download the latest Phar from https://github.com/mglaman/drupal-check/releases/latest, move into your path, profit!

Or, something like:

curl -O -L https://github.com/mglaman/drupal-check/releases/download/1.0.5/drupal-check.phar
chmod +x $(pwd)/drupal-check.phar
ln -s $(pwd)/drupal-check.phar /usr/local/bin/drupal-check
drupal-check /path/to/drupal/code_to_analyze

Building

The phar is built using humbug/box

macOS with bew:

brew tap humbug/box
brew install box
box -v
You can’t perform that action at this time.