File tree Expand file tree Collapse file tree 5 files changed +92
-210
lines changed Expand file tree Collapse file tree 5 files changed +92
-210
lines changed Original file line number Diff line number Diff line change 7
7
pull_request :
8
8
9
9
jobs :
10
- php-cs-fixer :
11
- runs-on : ubuntu-latest
12
- env :
13
- PHP_CS_FIXER_VERSION : v3.6.0
14
- strategy :
15
- matrix :
16
- php :
17
- - ' 8.1'
18
- steps :
19
- - name : Checkout
20
- uses : actions/checkout@v3
21
- - name : Setup PHP
22
- uses : shivammathur/setup-php@v2
23
- with :
24
- php-version : ${{ matrix.php }}
25
- extensions : curl,mbstring
26
- tools : php-cs-fixer:${{ env.PHP_CS_FIXER_VERSION }}
27
- coverage : none
28
- - name : Run PHP-CS-Fixer Fix, version ${{ env.PHP_CS_FIXER_VERSION }}
29
- run : php-cs-fixer fix --dry-run --diff --ansi
30
-
31
10
build :
32
11
runs-on : ${{ matrix.os }}
33
12
name : PHP v${{ matrix.php }} with MongoDB ${{ matrix.mongodb }}
Original file line number Diff line number Diff line change
1
+ name : " Coding Standards"
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ tags :
7
+ pull_request :
8
+
9
+ env :
10
+ PHP_VERSION : " 8.2"
11
+ DRIVER_VERSION : " stable"
12
+
13
+ jobs :
14
+ phpcs :
15
+ name : " phpcs"
16
+ runs-on : " ubuntu-22.04"
17
+
18
+ steps :
19
+ - name : " Checkout"
20
+ uses : " actions/checkout@v3"
21
+
22
+ - name : Setup cache environment
23
+ id : extcache
24
+ uses : shivammathur/cache-extensions@v1
25
+ with :
26
+ php-version : ${{ env.PHP_VERSION }}
27
+ extensions : " mongodb-${{ env.DRIVER_VERSION }}"
28
+ key : " extcache-v1"
29
+
30
+ - name : Cache extensions
31
+ uses : actions/cache@v3
32
+ with :
33
+ path : ${{ steps.extcache.outputs.dir }}
34
+ key : ${{ steps.extcache.outputs.key }}
35
+ restore-keys : ${{ steps.extcache.outputs.key }}
36
+
37
+ - name : " Install PHP"
38
+ uses : " shivammathur/setup-php@v2"
39
+ with :
40
+ coverage : " none"
41
+ extensions : " mongodb-${{ env.DRIVER_VERSION }}"
42
+ php-version : " ${{ env.PHP_VERSION }}"
43
+ tools : " cs2pr"
44
+
45
+ - name : " Show driver information"
46
+ run : " php --ri mongodb"
47
+
48
+ - name : " Install dependencies with Composer"
49
+ uses : " ramsey/composer-install@2.2.0"
50
+ with :
51
+ composer-options : " --no-suggest"
52
+
53
+ # The -q option is required until phpcs v4 is released
54
+ - name : " Run PHP_CodeSniffer"
55
+ run : " vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33
33
"require-dev" : {
34
34
"phpunit/phpunit" : " ^9.5.10" ,
35
35
"orchestra/testbench" : " ^8.0" ,
36
- "mockery/mockery" : " ^1.4.4"
36
+ "mockery/mockery" : " ^1.4.4" ,
37
+ "doctrine/coding-standard" : " 12.0.x-dev"
37
38
},
38
39
"replace" : {
39
40
"jenssegers/mongodb" : " self.version"
56
57
]
57
58
}
58
59
},
59
- "minimum-stability" : " dev"
60
+ "minimum-stability" : " dev" ,
61
+ "config" : {
62
+ "allow-plugins" : {
63
+ "dealerdirect/phpcodesniffer-composer-installer" : true
64
+ }
65
+ }
60
66
}
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <ruleset >
3
+ <arg name =" basepath" value =" ." />
4
+ <arg name =" extensions" value =" php" />
5
+ <arg name =" parallel" value =" 80" />
6
+ <arg name =" cache" value =" .phpcs-cache" />
7
+ <arg name =" colors" />
8
+
9
+ <!-- Ignore warnings (n), show progress of the run (p), and show sniff names (s) -->
10
+ <arg value =" nps" />
11
+
12
+ <file >src</file >
13
+ <file >tests</file >
14
+
15
+ <!-- Target minimum supported PHP version -->
16
+ <config name =" php_version" value =" 801000" />
17
+
18
+ <!-- ****************************************** -->
19
+ <!-- Import rules from doctrine/coding-standard -->
20
+ <!-- ****************************************** -->
21
+ <rule ref =" Doctrine" >
22
+ <exclude name =" SlevomatCodingStandard.ControlStructures.EarlyExit.UselessIfCondition" />
23
+ <exclude name =" SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing" />
24
+ <exclude name =" SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
25
+ <exclude name =" SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly" />
26
+ <exclude name =" SlevomatCodingStandard.Functions.ArrowFunctionDeclaration" />
27
+ <exclude name =" SlevomatCodingStandard.TypeHints.ParameterTypeHint" />
28
+ </rule >
29
+ </ruleset >
You can’t perform that action at this time.
0 commit comments