$ ddev composer require –dev mglaman/drupal-check
Tools overview
Tool | Interface | Functionality | Target Audience |
---|---|---|---|
Upgrade Status module | UI in Drupal | Identifies deprecated code, hosting environment compatibility, and more | Site administrators and developers |
Drupal Check | Command-line | Identifies deprecated code | Developers, especially during coding and continuous integration (CI) |
Upgrade Status module
Installation:
$ ddev drush pm-enable upgrade_status
I always rundrupal-check
before updating my Drupal site’s code and third-party dependencies. This helps ensure there are no compatibility issues with the current codebase before upgrading. I also rundrupal-check
after the update to identify any new issues introduced by the updated code.- To update the PHP version of DDEV, use the following command:
$ ddev composer require –dev drupal/upgrade_status
$ ddev debug migrate-database mariadb:10.11
Enable the Upgrade Status module:
The Upgrade Status module might recommend updating PHP and MySQL, per Drupal’s system requirements.
The Upgrade Status module assesses a Drupal site’s readiness for major version upgrades by checking for deprecated code and other compatibility issues.
Drupal Check
$ ddev config –-php-version 8.3
$ ./vendor/bin/drupal-check –-memory-limit 500M docroot/modules/custom
In the future, I’d like to evaluate whether using PHPStan directly is simpler. This is a TODO for myself. Drupal Check is essentially a wrapper around PHPStan, offering default configuration such as automatically running at level 2. To achieve the same result with PHPStan, I should be able to simply run:
When a new major version of Drupal is released, custom code often requires updates to align with API changes, including the removal of deprecated APIs.
Because I keep forgetting certain aspects of this workflow, I decided to document it for future reference.
Using PHPStan directly
Install the Upgrade Status module like you would install any other Drupal module:
$ php vendor/bin/phpstan analyze -l 2 docroot/modules/custom