Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbrumann/phpstan-rules
Collection of custom PHPStan rules
https://github.com/dbrumann/phpstan-rules
phpstan phpstan-rules
Last synced: 3 months ago
JSON representation
Collection of custom PHPStan rules
- Host: GitHub
- URL: https://github.com/dbrumann/phpstan-rules
- Owner: dbrumann
- Created: 2019-04-15T18:32:52.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-06-26T12:35:23.000Z (over 4 years ago)
- Last Synced: 2024-04-01T23:04:14.981Z (10 months ago)
- Topics: phpstan, phpstan-rules
- Language: PHP
- Size: 19.5 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Custom PHPStan Rules
====================Collection of custom PHPStan rules.
:warning: This is just a Proof of Concept
Installation
------------```bash
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:```yaml
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-rulesRules
-----**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.