PHPStan Playground: A Game-Changer for Drupal Developers

a person working in laptop
Freepik

Matt Glaman has unveiled an initiative within the Drupal community—the impending launch of a PHPStan Drupal extension, termed "Playground." This extension is poised to become a practical testing tool for developers, offering a controlled environment to assess and refine Drupal code through the lens of PHPStan. Positioned as a valuable resource, the Playground aims to enhance code quality and mitigate potential issues, addressing a crucial aspect of the development process.

Scheduled for release by the end of November, the Playground for phpstan-drupal signifies an important evolution in the functionality of PHPStan. Serving as an online testing platform, it proves invaluable for analyzing and testing code results, especially in bug-reporting scenarios. Matt Glaman, the driving force behind phpstan-drupal, has addressed the financial considerations of this open-source project by securing sponsorship from OPTASY through GitHub Sponsors, ensuring the coverage of operating costs.

Deployed through the Serverless framework on AWS Lambda, the Playground comprises three integral components: a playground-runner, a public API (playground-api), and a website interface. These components work in tandem to execute PHP code with PHPStan configuration, facilitate user interaction, and store results in an S3 bucket. Glaman acknowledges the challenge of integrating phpstan-drupal with the drupal/core package in the vendor directory, anticipating longer execution times for the Playground due to fewer expected visits. Initial support will focus on analyzing code against the latest Drupal version, with plans for customization options in subsequent iterations.

Despite making significant progress, challenges persist, particularly in code analysis discrepancies. While certain configurations yield correct depreciation errors, others, involving the \Drupal class, present debugging hurdles. Glaman outlines plans to optimize the playground-api code, align it with Drupal core's supported PHP versions, and explore accommodating multiple Drupal core versions. The ongoing efforts aim to position the Playground as a valuable resource, catering to developers seeking effective ways to refine and test their Drupal code within the evolving landscape of PHPStan and Drupal development. Read more here.

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 let us know in the comments below and we will try to address the issue as best we can.

Advertisement Here

Upcoming Events

Latest Opportunities

Advertisement Here