Member-only story

Deprecation message support for PHPStan

Matt Glaman
2 min readJul 2, 2019

The end of May brought two exciting releases for PHPStan and the PHPStan Deprecation Rules extension. With the version of PHPStan v0.11.8, descriptions added to the @deprecated tag can be parsed and returned in rule checks. The v0.11.2 of the PHPStan Deprecation Rules extension implements this feature and returns that description instead of a generic "Call to deprecated X Y" messaging.

Profile module deprecated message output

It is exciting to see this functionality in the wild. The original feature request, from November 2018, required feature development on PHPStan’s phpdoc-parser and PHPStan itself. The first bits of code landed in mid-March and the complete functionality released by the end of May. Gábor Hojtsy has already updated the Upgrade Status module to take advantage of these features.

Drupal Check was a little behind, but the ability to display messages now exists. The v1.0.11 release will display deprecated code usage descriptions. The tool currently requires a development tag of PHPStan until v0.11.9 is released. Drupal Check performs some unique loading techniques to support various ways users are installing the…

--

--

Matt Glaman
Matt Glaman

Written by Matt Glaman

PHP software engineer, open source contributor, and speaker

No responses yet