From ac6e0a4d9050febe17f6aa1761a3e0b7910238f1 Mon Sep 17 00:00:00 2001 From: Roman Zipp Date: Sun, 3 Oct 2021 10:45:24 +0200 Subject: [PATCH] Add phpstan --- .github/workflows/phpstan.yml | 23 +++++++++++++++++++++++ composer.json | 1 + phpstan.neon.dist | 5 +++++ 3 files changed, 29 insertions(+) create mode 100644 .github/workflows/phpstan.yml create mode 100644 phpstan.neon.dist diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..e6d3807 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,23 @@ +name: PHPStan + +on: [push] + +jobs: + phpstan: + + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: nanasess/setup-php@master + with: + php-version: 7.1 + + - name: Install dependencies + run: composer install --no-interaction --no-scripts --no-progress --prefer-dist + + - name: Execute PHPStan + run: vendor/bin/phpstan analyse diff --git a/composer.json b/composer.json index c7b5139..012fc87 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", "orchestra/testbench": "^3.8|^4.0|^5.0|^6.0", + "phpstan/phpstan": "^0.12.99", "phpunit/phpunit": "^7.0|^8.0|^9.0", "romanzipp/php-cs-fixer-config": "^3.0" }, diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..84d808d --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,5 @@ +parameters: + phpVersion: 70100 + level: 6 + paths: + - src