Skip to content

code style

code style #5

name: PHP_CodeSniffer
on:
push:
paths:
- "**.php"
- ".github/codestyle/phpcs_ruleset.xml"
- ".github/workflows/php_codesniffer.yml"
branches: [master, main]
pull_request:
paths:
- "**.php"
- ".github/codestyle/phpcs_ruleset.xml"
- ".github/workflows/php_codesniffer.yml"
branches: [master, main]
jobs:
phpcs:
name: PSR12 check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2
- name: Install Composer dependencies
run: composer install --no-progress --no-interaction
- name: Install PHP_CodeSniffer
run: composer require --dev "squizlabs/php_codesniffer"
- name: Run PHP_CodeSniffer
run: php vendor/bin/phpcs --config-set show_warnings 0 && php vendor/bin/phpcs --standard=PSR12 --ignore=vendor/ --extensions=php .