Skip to main content

Announcing bitexpert/phpstan-sylius 0.2.0

· 2 min read
Stephan Hochdörfer
Head of IT Business Operations

Earlier this year, I began working on a PHPStan extension for Sylius at the Sylius hackathon in Cologne. After meeting Ondřej Mirtes at a conference last month, I was motivated to prepare a first release of the extension.

In recent weeks, I released the first version of the extension and added several improvements, laying the groundwork for the latest 0.2.0 release of the bitexpert/phpstan-sylius package.

What's new?

The latest release brings significant enhancements, including:

  • Improved rules for detecting invalid grid configurations, such as wrongly chained properties.
  • Extensibility for custom grid filter implementations, allowing for greater flexibility and customization.

To leverage this feature, implement the bitExpert\PHPStan\Sylius\Collector\Grid\Filter\FilterNode interface for your custom filter to return the fields used for filtering. The service needs to be added to your phpstan.neon file and tagged with the phpstan.sylius.grid.filter tag.

We have tested the extension with several of our Sylius plugins, as well as two of our current merchant projects. However, we believe that the true test of the extension's value lies in its adoption and feedback from the broader Sylius community. We encourage you to try out the extension and share your thoughts, suggestions, and experiences with us.

To try out the extension, you can install the latest version via Composer:

composer.phar require --dev bitexpert/phpstan-sylius