3

I created a custom module in Drupal 8 for a specific purpose.

How can I find out if it contains any deprecated functions?

2
  • Some IDEs can point out when using deprecated class or function e.g. Phpstorm. Also, you can check this repository github.com/mglaman/drupal-check Commented Aug 16, 2019 at 11:01
  • This question might be a bit off topic since it depends on which IDE you are using, or if you are using any IDE. If you don't use any smart IDE's you can search manually through your project, here's a list of all deprecated functions in Drupal 8.7. If you are using PHPStorm there is already an answer here.
    – user72672
    Commented Aug 16, 2019 at 11:46

1 Answer 1

4

Read Dries Buytaert's blog post on How to prepare for Drupal 9

drupal-check

If you work on a Drupal site as a developer, run drupal-check. Matt Glaman (Centarro) developed a static PHP analysis tool called drupal-check, which you can run against your codebase to check for deprecated code. I recommend running drupal-check in an automated fashion as part of your development workflow.

Link: https://github.com/mglaman/drupal-check

Upgrade Status

If you are a site owner, install the Upgrade Status module. This module was built by Acquia. The module provides a graphical user interface on top of drupal-check. The goal is to provide an easy-to-use readiness assessment for your site's migration to Drupal 9.

Link: https://drupal.org/project/upgrade_status


Maybe also learn the background info of drupal-check reading Matt Glaman's blog post about Testing your Drupal code base for deprecated code usage with PHPStan.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.