name: "Check phpmd"

on:
  pull_request:

jobs:
  coding-standards:
    name: "Check phpmd"

    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: "7.4"
          tools: composer:v2

      - name: Install dependencies
        run: composer require phpmd/phpmd --no-interaction --no-progress

      - name: Run phpmd
        run: vendor/bin/phpmd classes/ text cleancode,codesize,controversial,design,naming,unusedcode
