diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 98da305..b85b8c6 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -69,6 +69,9 @@ jobs: - name: Run tests run: XDEBUG_MODE=coverage php vendor/bin/codecept run --coverage --coverage-xml + - name: Run static code analysis + run: vendor/bin/phpstan analyse + - name: Archive failed tests artifacts - test output & log uses: actions/upload-artifact@v2 if: failure() diff --git a/composer.json b/composer.json index 365c577..177eee8 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,8 @@ "codeception/module-filesystem": "^1.0", "codeception/module-yii2": "^1.1", "codeception/module-asserts": "^1.1", - "codeception/module-db": "^1.0" + "codeception/module-db": "^1.0", + "phpstan/phpstan": "^1.8" }, "autoload": { "psr-4": { @@ -74,6 +75,9 @@ } }, "config": { + "platform": { + "php": "7.3" + }, "preferred-install": { "*": "auto" }, diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..87f9d94 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,8 @@ +parameters: + level: 0 + paths: + - src + excludePaths: + - 'src/resources/i18n/*' + bootstrapFiles: + - stan_autoload.php diff --git a/stan_autoload.php b/stan_autoload.php new file mode 100644 index 0000000..1ed0dc1 --- /dev/null +++ b/stan_autoload.php @@ -0,0 +1,4 @@ +