https://github.com/matlad/phpstancs
Allows you to fob off the phpStan report into phpStorm
https://github.com/matlad/phpstancs
phpstan phpstorm
Last synced: about 1 month ago
JSON representation
Allows you to fob off the phpStan report into phpStorm
- Host: GitHub
- URL: https://github.com/matlad/phpstancs
- Owner: matlad
- Archived: true
- Created: 2019-01-06T21:32:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-23T10:02:42.000Z (about 5 years ago)
- Last Synced: 2025-07-20T19:49:40.337Z (7 months ago)
- Topics: phpstan, phpstorm
- Language: PHP
- Homepage:
- Size: 354 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Abandoned
no more needed phpstorm support phpsan now (EAP 2020.3). https://blog.jetbrains.com/phpstorm/2020/07/phpstan-and-psalm-support-coming-to-phpstorm/
phpStanCs
=========
This is small hack, that allows you to fob off the phpStan report into phpStorm as a PHP code sniffer.
This is not really good solution, but i don't know Java and this wos easier for me.
This is for now, till plugin would be created. I heard somewhere, that somebody may working on it.


## Install
You need composer https://getcomposer.org/
Than go to project directory and run in console
```bash
composer require --dev matla/phpstancs
```
## Usage and settings
### PhpStorm settings
Open File->Settings->Language & Frameworks -> PHP -> Quality Tools -> Code Sniffer
and set path to __vendor/matla/phpstancs/bin/phpcs__

You also need allowed inspection from phpcs

### PhpStan and PhpStanCS setup
Config phpStan is possible only by file phpstan.neon
in root directory of project (location of composer.json).
If file like this exist, than you must install this extension
either automatically using "phpstan/extension-installer" or by including in your phpstan.neon.
eg.
```neon
includes:
- vendor/matla/phpstancs/extension.neon
```
Settings for phpStanCs are in same file.
It is parameter runCS (bool), which turn on/of phpcs inspection which is marget with php stan results.
```neon
parameters:
phpstancs:
runCS : true
```
## Authors
* Adam Mátl