File tree Expand file tree Collapse file tree 5 files changed +236
-4
lines changed Expand file tree Collapse file tree 5 files changed +236
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : PHPCS
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+ push :
8
+ branches :
9
+ - main
10
+
11
+ jobs :
12
+ phpcs :
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - name : Checkout code
17
+ uses : actions/checkout@v2
18
+
19
+ - name : Set up PHP
20
+ uses : shivammathur/setup-php@v2
21
+ with :
22
+ php-version : ' 8.1'
23
+
24
+ - name : Install dependencies
25
+ run : composer install
26
+
27
+ - name : Get list of changed files
28
+ id : changed-files
29
+ uses : tj-actions/changed-files@v34
30
+
31
+ - name : Run PHPCS
32
+ run : |
33
+ CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '\.php$' || true)
34
+ if [ -n "$CHANGED_FILES" ]; then
35
+ vendor/bin/phpcs --standard=PSR12 $CHANGED_FILES
36
+ else
37
+ echo "No PHP files changed, skipping PHPCS."
38
+ fi
Original file line number Diff line number Diff line change
1
+ name : PHPStan
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+ push :
8
+ branches :
9
+ - main
10
+
11
+ jobs :
12
+ phpstan :
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - name : Checkout code
17
+ uses : actions/checkout@v2
18
+
19
+ - name : Set up PHP
20
+ uses : shivammathur/setup-php@v2
21
+ with :
22
+ php-version : ' 8.1'
23
+
24
+ - name : Install dependencies
25
+ run : composer install
26
+
27
+ - name : Get list of changed files
28
+ id : changed-files
29
+ uses : tj-actions/changed-files@v34
30
+
31
+ - name : Run PHPStan
32
+ run : |
33
+ CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '\.php$' || true)
34
+ if [ -n "$CHANGED_FILES" ]; then
35
+ vendor/bin/phpstan analyse $CHANGED_FILES
36
+ else
37
+ echo "No PHP files changed, skipping PHPStan."
38
+ fi
Original file line number Diff line number Diff line change 3
3
"description" : " A content generator for PHP" ,
4
4
"type" : " library" ,
5
5
"require" : {
6
- "php" : " >=7.4 " ,
6
+ "php" : " >=8.1 " ,
7
7
"mustache/mustache" : " ^2.13"
8
8
},
9
9
"autoload" : {
12
12
}
13
13
},
14
14
"require-dev" : {
15
- "phpunit/phpunit" : " ^9.5"
15
+ "phpunit/phpunit" : " ^9.5" ,
16
+ "phpstan/phpstan" : " ^1.0" ,
17
+ "squizlabs/php_codesniffer" : " ^3.0"
16
18
},
17
19
"scripts" : {
18
20
"test" : " phpunit"
Original file line number Diff line number Diff line change
1
+ parameters :
2
+ level : max
3
+ paths :
4
+ - src
5
+
6
+ # Optional: Include bootstrap file if necessary and ensure the path is correct
7
+ bootstrapFiles :
8
+ - vendor/autoload.php
9
+
10
+ # Optional: Add any other configuration options as needed
You can’t perform that action at this time.
0 commit comments