Files
predis/.github/workflows/coding-standards.yml
T
Viktor Szépe c201af5ad3 Fix PHPStan level 2 problems (#1025)
* Fix almost all PHPStan level 2 problems

* Fix master loop and remove empty line

* Fix variadic functions

* Fix CS

* Disable xdebug in CI and improve a condition

* Fix CI fix
2023-01-20 14:20:53 -08:00

62 lines
1.5 KiB
YAML

name: Linters
on:
push:
branches:
- main
- v2.**
pull_request:
jobs:
php-cs-fixer:
name: PHP CS Fixer
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.1
tools: php-cs-fixer
- 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
coverage: none
- 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
run: composer install --ansi --no-progress --prefer-dist ${{ matrix.php == '8.0' && '--ignore-platform-reqs' || '' }}
- name: Run PHPStan
run: phpstan analyse