Matt Glaman Writes About phpstan-drupal's Compatibility with PHPStan 2.0
The popular PHP analysis tool, phpstan-drupal, has officially released a version compatible with PHPStan 2.0, marking a significant milestone for Drupal developers. This update follows the release of PHPStan 2.0, which introduced several key changes aimed at improving code analysis and development workflows. Matt Glaman, in his recent blog post, delves into the details of this development.
The new phpstan-drupal 2.0.0 release comes with notable updates, most prominently the removal of support for Drupal 9. This change led to the elimination of over 1,000 lines of code, streamlining the project's maintainability. According to the announcement, the 1.x branch will continue to be maintained as long as any version of Drupal Core relies on it, with an expected end-of-life aligning with Drupal 10’s support ending in late 2026.
While Drupal Core has not yet adopted PHPStan 2.0, the availability of a compatible phpstan-drupal version removes a major barrier. Efforts to upgrade Drupal Core’s compatibility are ongoing, with updates anticipated before the release of Drupal 11.2.0.
Developers are encouraged to follow the progress of the Drupal Core update and explore potential opportunities to incorporate phpstan-drupal’s features directly into Drupal Core.


