Add phpstan level 0 (#1022)

* Remove unused arguments

* Fix return types

* Removed unused parameter and argument

* Add phpstan job

* merge files

* Delete phpstan-baseline.neon

* Delete static-analysis.yml

* merge workflows

* Update composer.json

* format yaml

* install composer reps

* fix yaml

Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
This commit is contained in:
Fran Moreno
2023-01-18 22:33:51 +01:00
committed by GitHub
parent 7a4b3d1d0f
commit 3daf75508d
12 changed files with 83 additions and 19 deletions
+36 -2
View File
@@ -10,7 +10,7 @@ on:
jobs:
php-cs-fixer:
name: linter
name: PHP CS Fixer
runs-on: ubuntu-latest
steps:
@@ -19,10 +19,44 @@ jobs:
uses: actions/checkout@v3
- name: Setup PHP with Composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: php-cs-fixer
uses: shivammathur/setup-php@v2
- name: Run php-cs-fixer
run: php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=no
phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP with Composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: phpstan
- name: Get Composer cache directory
id: composer-cache
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.directory }}
key: tests-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: tests-php-${{ matrix.php }}-composer
- name: Install Composer dependencies
env:
PHP_VERSION: ${{ matrix.php }}
run: composer install --ansi --no-progress --prefer-dist $(if [ "$PHP_VERSION" == "8.0" ]; then echo "--ignore-platform-reqs"; fi;)
- name: Run PHPStan
run: phpstan analyse