Skip to content

Remove PHPStan ignore as WP 6.5 Stubs were released #646

Remove PHPStan ignore as WP 6.5 Stubs were released

Remove PHPStan ignore as WP 6.5 Stubs were released #646

name: Static Analysis
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
paths:
# Any change to a PHP file should run checks.
- '**.php'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
# This file configures PHPStan. Changes could affect the outcome.
- 'phpstan.neon'
# Changes to workflow files should always verify all workflows are successful.
- '.github/workflows/*.yml'
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
jobs:
# Runs PHPStan Static Analysis.
#
# Violations are reported inline with annotations.
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up PHP.
# - Logs debug information.
# - Installs Composer dependencies (use cache if possible).
# - Runs PHPStan on the full codebase.
phpstan:
name: Static Analysis (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3'] # 7.4 is the minimum supported version.
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@2.31.1
with:
php-version: ${{ matrix.php-versions }}
coverage: none
env:
fail-fast: false
- name: Log debug information
run: |
php --version
composer --version
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Run PHPStan static analysis (PHP ${{ matrix.php-versions }})
run: composer lint:phpstan