Download the PHP package efabrica/phpstan-rules without Composer
On this page you can find all versions of the php package efabrica/phpstan-rules. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phpstan-rules
eFabrica PHPStan extension
Extension for PHPStan is providing several services and rules to help find bugs in your applications.
Installation
To use this extension, require it in Composer:
Setup
This extension adds several rules. You can use them all by including these files in your phpstan.neon
:
Or include just:
and pick rules you want to use
Guzzle - ClientCallWithoutOptionRule
Finds all calls of GuzzleHttp\Client methods without some option e.g. timeout, connect_timeout
:x:
:+1:
Tomaj/Nette API - InputParamNameRule
Checks if names of all input parameters. Every name has to contain only alphanumeric characters and _
:x:
:+1:
Check trait context - TraitContextRule
Checks if traits are used only in context of classes specified in them via comment @context {Type}
:x:
:+1:
Check calling method in object method
Checks if some method is not used in disabled context - specific method of object.
:x:
:+1:
Check calling method with required parameters
Checks if some method is called with all required parameters with corresponding types.
:x:
:+1:
Do not concatenate translated strings
Every language has its own word order in sentences, we can't use e.g. variables at the same place for all languages. There are mechanisms in translate libraries e.g. symfony/translator - we can use placeholders like %name% etc. This rule checks if you use translated messages and then concat them with some other strings.
:x:
:+1:
Forbidden constructor parameters types
This rule checks if constructor contains forbidden parameter types.
:x:
:+1:
Performance - DisabledCallsInLoopsRule
Some functions are not recommended to be called in loops. For example array_merge.
:x:
:+1: