name: PHP-CS-Fixer

on:
  pull_request:
  push:
    branches:
      - 1.x
      - 2.x

jobs:
  php-cs-fixer:
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 7.4
          coverage: none
          tools: php-cs-fixer

      - name: Run PHP-CS-Fixer
        run: php-cs-fixer fix --dry-run --diff
