name: PHPStan

on:
  push:
    paths:
      - '**.php'
      - 'phpstan.neon.dist'

jobs:
  phpstan:
    name: phpstan
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7

      - name: Setup PHP
        uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
        with:
          php-version: '8.3'
          coverage: none

      - name: Install composer dependencies
        uses: ramsey/composer-install@26d8a556604053a9612623447203a691f406fbe6 # v4

      - name: Run PHPStan
        run: ./vendor/bin/phpstan --error-format=github
