diff --git a/.github/workflows/phpcodesniffer.yml b/.github/workflows/phpcodesniffer.yml new file mode 100644 index 0000000000..bbc4d4de51 --- /dev/null +++ b/.github/workflows/phpcodesniffer.yml @@ -0,0 +1,24 @@ +name: PHP CodeSniffer + +# Controls when the action will run. +on: ['pull_request','push','pull_request_target'] +jobs: + phpcs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # important! + - name: Install PHP_CodeSniffer + run: | + curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar + php phpcs.phar --version + + - uses: domjudge/action-php-codesniffer@master + with: + files: "**.php" # you may customize glob as needed + scope: files + phpcs_path: php phpcs.phar + standard: .github/workflowscripts/phpruleset.xml + fail_on_errors: false + fail_on_warnings: false diff --git a/.github/workflowscripts/phpruleset.xml b/.github/workflowscripts/phpruleset.xml new file mode 100644 index 0000000000..1467004353 --- /dev/null +++ b/.github/workflowscripts/phpruleset.xml @@ -0,0 +1,346 @@ + + + The PSR-12 coding standard. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + error + Method name "%s" must not be prefixed with an underscore to indicate visibility + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + + + + + + + + + + + + + + + 0 + + + 0 + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +