Skip to content

Collection of custom PHPStan rules

Notifications You must be signed in to change notification settings

dbrumann/phpstan-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom PHPStan Rules

Collection of custom PHPStan rules.

⚠️ This is just a Proof of Concept

Installation

composer require --dev brumann/phpstan-rules

Usage

To enable all rules with their default configuration you can just include the provided rules.neon file in your phpstan.neon like this:

includes:
    - vendor/brumann/phpstan-rules/rules.neon

If you want to enable only selective rules you can also manually configure the rules in your phpstan.neon as is described in the docs: https://github.com/phpstan/phpstan#custom-rules

Rules

ConstructorPreferInterface

This Rule ensures that when a constructor argument is an object, type hints are for an appropriate interface, instead of a concrete implementation. Optionally you can provide a list of Interfaces to be ignored.

About

Collection of custom PHPStan rules

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages