Matt Glaman Writes About phpstan-drupal's Compatibility with PHPStan 2.0

PHP

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.

Reference: phpstan-drupal now supports PHPStan 2.0 (12 December 2024)

Disclosure: This content is produced with the assistance of AI.

Disclaimer: The opinions expressed in this story do not necessarily represent that of TheDropTimes. We regularly share third-party blog posts that feature Drupal in good faith. TDT recommends Reader's discretion while consuming such content, as the veracity/authenticity of the story depends on the blogger and their motives. 

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Upcoming Events

Latest Opportunities