Generic rules extensions for PHPStan

Installs: 641 020

Dependents: 8

Suggesters: 2

Security: 0

Stars: 11

Watchers: 3

Forks: 4

Open Issues: 0


v1.0.0 2021-11-05 15:31 UTC

This package is auto-updated.

Last update: 2024-02-05 20:19:22 UTC


Rules list

Debug rules

  • You should not have var_dump, exit or die function calls
  • If you have symfony/var-dumper, you should not have dump or die function calls

MbString rules

  • You should use multibyte string function when it exists


We assume that PHPStan is already installed in your project.

To use this extension, require it in Composer:

composer require --dev korbeil/phpstan-generic-rules

If you also install phpstan/extension-installer then you're all set!

Manual installation

If you don't want to use phpstan/extension-installer, include phpstan-strict-rules.neon in your project's PHPStan config:

    - vendor/korbeil/phpstan-generic-rules/extension.neon

Advanced usage

You can configure this library with parameters:

        debug_rule: false  # To disable the debug rule
        mb_string_rules: false  # To disable the mb_string rule