Skip to content

hirokinoue/phpstan-custom-rule-development

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phpstan-custom-rule-development

PHPStanのCustom Rule開発環境サンプル

ディレクトリ構成

.
|-- Rules
|   `-- MyRule.php           # カスタムルール
|-- Tests
|   `-- MyRuleTest
|       |-- data
|       |   `-- my-rule.php  # テストデータ
|       `-- MyRuleTest.php   # テストコード
|-- src                  
|   `-- SomeClass.php        # 解析対象のコード
`-- phpstan.neon             # config(実行したいCustom Ruleをここで指定する)

参考

起動

make run

イメージ、コンテナの削除

make clean

解析実行

XDEBUG_MODE=off ./vendor/bin/phpstan analyze -l 0 src
XDEBUG_MODE=off ./vendor/bin/phpstan analyse -l 0 --debug src
XDEBUG_MODE=off ./vendor/bin/phpstan clear-result-cache

ユニットテスト

XDEBUG_MODE=off ./vendor/bin/phpunit Tests

デバッグ

--xdebugオプションを付けて実行する。並行処理を無効化するため--debugオプションも付ける。

./vendor/bin/phpstan analyze --debug --xdebug -l 0 src 

About

PHPStanのCustom Rule開発環境サンプル

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published