PHPackages                             bitexpert/phpstan-sylius - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. bitexpert/phpstan-sylius

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

bitexpert/phpstan-sylius
========================

Sylius extensions and rules for PHPStan

v0.3.0(3mo ago)73.1k—7.4%12MITPHPPHP ^8.2CI passing

Since Oct 8Pushed 6d ago4 watchersCompare

[ Source](https://github.com/bitExpert/phpstan-sylius)[ Packagist](https://packagist.org/packages/bitexpert/phpstan-sylius)[ RSS](/packages/bitexpert-phpstan-sylius/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (14)Versions (18)Used By (2)

bitexpert/phpstan-sylius
========================

[](#bitexpertphpstan-sylius)

[![Build Status](https://github.com/bitExpert/phpstan-sylius/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/bitExpert/phpstan-sylius/actions)[![installs on Packagist](https://camo.githubusercontent.com/d2de4d885bd77a844b847d167897e24fc25e0c980757288ae57793910170f88c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6269746578706572742f7068707374616e2d73796c697573)](https://packagist.org/packages/bitexpert/phpstan-sylius/)[![Mastodon Follow](https://camo.githubusercontent.com/c2abd2d790b2fdf042e992e8872c59044086bdb16b119a61d8526d6238c3c2ba/68747470733a2f2f696d672e736869656c64732e696f2f6d6173746f646f6e2f666f6c6c6f772f3130393430383638313234363937323730303f646f6d61696e3d68747470733a2f2f726865696e6e65636b61722e736f6369616c)](https://rheinneckar.social/@bitexpert)

This package provides some additional features for PHPStan to detect configuration issues in Sylius projects.

Requirements
------------

[](#requirements)

PHP: PHP 8.2 or higher

Sylius: Sylius 2.0 or higher

PHPStan: PHPStan 2.0 or higher

Installation
------------

[](#installation)

The preferred way of installing `bitexpert/phpstan-sylius` is through Composer. You can add `bitexpert/phpstan-sylius` as a dev dependency, as follows:

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

```

### PHPStan configuration

[](#phpstan-configuration)

If you have not already a PHPStan configuration file `phpstan.neon` in your project, create a new empty file next to your `composer.json` file.

See [here](https://phpstan.org/config-reference) what options PHPStan allows you to configure.

Feature overview
----------------

[](#feature-overview)

This PHPStan extension works for both Sylius plugins and Sylius application projects.

The following rules have been implemented:

- Rule to check if resource classes defined either via AbstractGrid::getResourceClass() or the #AsGrid attribute exist
- Rule to check that configured grid fields belong to the configured resource class
- Rule to check that configured filter fields belong to the configured resource class
    - custom filter types are supported
- Rule to check that grid class configured via the `Index` attribute exists
- Rule to check that form type configured via the `AsResource` attribute exists

Current assumptions:

- Grids are configured by extending the `Sylius\Bundle\GridBundle\Grid\AbstractGrid` class

### Custom filter types

[](#custom-filter-types)

To include your custom filter type in the checks, implement the `bitExpert\PHPStan\Sylius\Collector\Grid\Filter\FilterNode` interface and add a service to your `phpstan.neon` file and tag it with the `phpstan.sylius.grid.filter` tag.

Contribute
----------

[](#contribute)

Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and adapt the documentation.

Want To Contribute?
-------------------

[](#want-to-contribute)

If you feel that you have something to share, then we’d love to have you. Check out [the contributing guide](CONTRIBUTING.md) to find out how, as well as what we expect from you.

License
-------

[](#license)

PHPStan Sylius Extension is released under the MIT License.

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance91

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~82 days

Total

3

Last Release

105d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1adf0ab660536efce10aeb97f0c90ec881110b64fbd23429fa945190df0def56?d=identicon)[shochdoerfer](/maintainers/shochdoerfer)

---

Top Contributors

[![shochdoerfer](https://avatars.githubusercontent.com/u/596449?v=4)](https://github.com/shochdoerfer "shochdoerfer (110 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (64 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/bitexpert-phpstan-sylius/health.svg)

```
[![Health](https://phpackages.com/badges/bitexpert-phpstan-sylius/health.svg)](https://phpackages.com/packages/bitexpert-phpstan-sylius)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.4k](/packages/larastan-larastan)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79475.7M2.2k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67272.8M1.4k](/packages/phpstan-phpstan-doctrine)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

4853.5M91](/packages/shipmonk-dead-code-detector)[spaze/phpstan-disallowed-calls

PHPStan rules to detect disallowed method &amp; function calls, constant, namespace, attribute, property &amp; superglobal usages, with powerful rules to re-allow a call or a usage in places where it should be allowed.

33422.6M550](/packages/spaze-phpstan-disallowed-calls)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20731.4M188](/packages/mglaman-phpstan-drupal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
