matla/phpstancs

This package is abandoned and no longer maintained. The author suggests using the no needed any more https://blog.jetbrains.com/phpstorm/2020/07/phpstan-and-psalm-support-coming-to-phpstorm/ package instead.

Allows you to fob off the phpStan report into phpStorm

Installs: 1 057

Dependents: 0

Suggesters: 0

Security: 0

Stars: 9

Watchers: 2

Forks: 2

Open Issues: 0

Type:phpstan-extension

0.0.4 2020-02-01 19:19 UTC

This package is auto-updated.

Last update: 2020-11-23 10:02:45 UTC


README

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.

notice example

inspection example

Install

You need composer https://getcomposer.org/ Than go to project directory and run in console

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 img You also need allowed inspection from phpcs img2

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.

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.

parameters:
    phpstancs:
	    runCS : true

Authors