Skip to content

Commit

Permalink
lint-php.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
freescout-help-desk committed Sep 23, 2023
1 parent b32320d commit cacdf09
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: lint-php

on:
push:
branches:
- master
- dist
workflow_dispatch:

jobs:
build:
name: Lint PHP
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: phpcs

- name: Run check
run: phpcs
33 changes: 33 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
<description>Coding Standard</description>

<file>app</file>
<file>bootstrap/app.php</file>
<file>database</file>
<file>public/index.php</file>
<file>public/tools.php</file>
<file>public/install.php</file>
<file>routes</file>
<file>tests</file>
<file>overrides</file>

<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="parallel" value="75"/>

<rule ref="PSR12"/>

<rule ref="PSR1.Methods.CamelCapsMethodName">
<exclude-pattern>./tests/*</exclude-pattern>
</rule>

<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>./tests/*</exclude-pattern>
</rule>

<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>./database/*</exclude-pattern>
</rule>

</ruleset>

0 comments on commit cacdf09

Please sign in to comment.