Skip to content

Commit e62e9f6

Browse files
authored
Phpcs + phpstan (#72)
* phpcs * phpstan * licence-headers-check * public/lib
1 parent ff59d3c commit e62e9f6

13 files changed

+432
-56
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Continuous integration"
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- "*"
9+
pull_request:
10+
schedule:
11+
- cron: "0 0 * * *"
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: true
17+
18+
jobs:
19+
generate-ci-matrix:
20+
name: "Generate CI matrix"
21+
uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1"
22+
with:
23+
glpi-version: "10.0.x"
24+
ci:
25+
name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}"
26+
needs: "generate-ci-matrix"
27+
strategy:
28+
fail-fast: false
29+
matrix: ${{ fromJson(needs.generate-ci-matrix.outputs.matrix) }}
30+
uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1"
31+
with:
32+
plugin-key: "gantt"
33+
glpi-version: "${{ matrix.glpi-version }}"
34+
php-version: "${{ matrix.php-version }}"
35+
db-image: "${{ matrix.db-image }}"

.phpcs.xml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<ruleset>
3+
<file>.</file>
4+
<exclude-pattern>/.git/</exclude-pattern>
5+
<exclude-pattern type="relative">^vendor/</exclude-pattern>
6+
7+
<arg name="colors" />
8+
<arg name="extensions" value="php" />
9+
<arg value="p" />
10+
<arg name="warning-severity" value="0" />
11+
12+
<rule ref="PSR12">
13+
<exclude name="Generic.Files.LineLength" />
14+
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
15+
</rule>
16+
<rule ref="Generic.Arrays.ArrayIndent"></rule>
17+
</ruleset>
18+

composer.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@
33
"php": ">=7.4"
44
},
55
"require-dev": {
6-
"glpi-project/tools": "^0.7"
6+
"glpi-project/tools": "^0.7.2",
7+
"php-parallel-lint/php-parallel-lint": "^1.4",
8+
"phpstan/extension-installer": "^1.3",
9+
"phpstan/phpstan": "^1.10",
10+
"phpstan/phpstan-deprecation-rules": "^1.1",
11+
"squizlabs/php_codesniffer": "^3.9"
712
},
813
"config": {
914
"optimize-autoloader": true,
1015
"platform": {
1116
"php": "7.4.0"
1217
},
13-
"sort-packages": true
18+
"sort-packages": true,
19+
"allow-plugins": {
20+
"phpstan/extension-installer": true
21+
}
1422
}
1523
}

composer.lock

+293-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)