https://github.com/mhujer/phpstan-rules
Custom PHPStan Rules (for https://github.com/phpstan/phpstan)
https://github.com/mhujer/phpstan-rules
php phpstan phpstan-extension phpstan-rules static-analysis
Last synced: 7 months ago
JSON representation
Custom PHPStan Rules (for https://github.com/phpstan/phpstan)
- Host: GitHub
- URL: https://github.com/mhujer/phpstan-rules
- Owner: mhujer
- License: mit
- Created: 2017-07-21T18:31:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-05T12:48:37.000Z (over 4 years ago)
- Last Synced: 2024-11-09T20:33:48.529Z (over 1 year ago)
- Topics: php, phpstan, phpstan-extension, phpstan-rules, static-analysis
- Language: PHP
- Homepage:
- Size: 43 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Custom PHPStan Rules
[](https://travis-ci.org/mhujer/phpstan-rules)
[](https://coveralls.io/github/mhujer/phpstan-rules)
[](https://packagist.org/packages/mhujer/phpstan-rules)
[](https://packagist.org/packages/mhujer/phpstan-rules)
This repository provides following custom rules for [PHPStan](https://github.com/phpstan/phpstan):
* Check that the `__construct()` is the first method in the class.
* If the `__construct` contains `Doctrine\ORM\EntityManagerInterface` as a parameter, it must be sorted as the last one.
## Usage
To use those rules, require them in [Composer](https://getcomposer.org/):
```bash
composer require --dev mhujer/phpstan-rules
```
And include them in your project's PHPStan config:
```yaml
includes:
- vendor/mhujer/phpstan-rules/rules.neon
```