korbeil / phpstan-generic-rules
Generic rules extensions for PHPStan
Installs: 868 873
Dependents: 8
Suggesters: 2
Security: 0
Stars: 11
Watchers: 3
Forks: 5
Open Issues: 0
Type:phpstan-extension
Requires
- php: >=7.2
- nikic/php-parser: ^4.0||^5.0
- phpstan/phpstan: ^0.11 || ^0.12 || ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.2
- symfony/var-dumper: ^4.3
This package is auto-updated.
Last update: 2024-10-31 15:40:49 UTC
README
Rules list
Debug rules
- You should not have
var_dump
,exit
ordie
function calls - If you have
symfony/var-dumper
, you should not havedump
ordie
function calls
MbString rules
- You should use multibyte string function when it exists
Installation
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:
includes: - vendor/korbeil/phpstan-generic-rules/extension.neon
Advanced usage
You can configure this library with parameters:
parameters:
generic_rules:
debug_rule: false # To disable the debug rule
mb_string_rules: false # To disable the mb_string rule