From 1b405f33c9e6d4f4d6aa353324e3af5236152d3a Mon Sep 17 00:00:00 2001 From: Pen-y-Fan <40126936+Pen-y-Fan@users.noreply.github.com> Date: Mon, 18 May 2020 22:42:07 +0100 Subject: [PATCH] Added ECS and PHPStan With helper batch files --- php/cc.bat | 1 + php/ecs.yaml | 12 ++++++++++++ php/fc.bat | 1 + php/phpstan.neon | 26 ++++++++++++++++++++++++++ php/ps.bat | 1 + php/pu.bat | 1 + 6 files changed, 42 insertions(+) create mode 100644 php/cc.bat create mode 100644 php/ecs.yaml create mode 100644 php/fc.bat create mode 100644 php/phpstan.neon create mode 100644 php/ps.bat create mode 100644 php/pu.bat diff --git a/php/cc.bat b/php/cc.bat new file mode 100644 index 0000000..fa81b65 --- /dev/null +++ b/php/cc.bat @@ -0,0 +1 @@ +composer check-cs diff --git a/php/ecs.yaml b/php/ecs.yaml new file mode 100644 index 0000000..b89d979 --- /dev/null +++ b/php/ecs.yaml @@ -0,0 +1,12 @@ +parameters: + sets: + - 'psr12' + - 'php71' + - 'symplify' + - 'common' + - 'clean-code' + + line_ending: "\n" + + # 4 spaces + indentation: " " diff --git a/php/fc.bat b/php/fc.bat new file mode 100644 index 0000000..c571652 --- /dev/null +++ b/php/fc.bat @@ -0,0 +1 @@ +composer fix-cs diff --git a/php/phpstan.neon b/php/phpstan.neon new file mode 100644 index 0000000..b1590db --- /dev/null +++ b/php/phpstan.neon @@ -0,0 +1,26 @@ +includes: + - vendor/symplify/phpstan-extensions/config/config.neon + - vendor/phpstan/phpstan-phpunit/extension.neon + +parameters: + paths: + - src + - tests + + # The level 8 is the highest level + level: 8 + + # Larstan recommendation: + checkMissingIterableValueType: false + + ignoreErrors: + + # buggy + + # mixed + + # cache buggy + + # tests + + # iterable diff --git a/php/ps.bat b/php/ps.bat new file mode 100644 index 0000000..8bda091 --- /dev/null +++ b/php/ps.bat @@ -0,0 +1 @@ +composer phpstan diff --git a/php/pu.bat b/php/pu.bat new file mode 100644 index 0000000..b49ed1f --- /dev/null +++ b/php/pu.bat @@ -0,0 +1 @@ +composer test