Skip to content

Commit 653044a

Browse files
committed
PHPCS configured
1 parent 9dad20c commit 653044a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.github/workflows/code-style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ jobs:
99
- name: Composer dependencies
1010
run: composer install
1111
- name: Run Testsuite
12-
run: composer run-script cs
12+
run: composer run-script phpcs

.phpcs.xml.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010
<arg name="extensions" value="php"/>
1111
<arg name="cache" value=".phpcs.cache"/>
1212

13+
<rule ref="PHPCompatibilityWP" />
14+
1315
<rule ref="WordPress">
1416
<!-- PSR4 -->
1517
<exclude name="WordPress.Files.FileName" />
1618
</rule>
1719
<rule ref="WordPress-Extra"/>
1820
<rule ref="WordPress-Docs"/>
21+
22+
<exclude-pattern>*/node_modules/*</exclude-pattern>
23+
<exclude-pattern>*/vendor/*</exclude-pattern>
1924
</ruleset>

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@
4747
"phpunit/phpunit": "^9.6",
4848
"brain/monkey": "^2.0@dev",
4949
"phpstan/phpstan-mockery": "^2.0",
50-
"lloc/composer-i18n-scripts": "^1.0"
50+
"lloc/composer-i18n-scripts": "^1.0",
51+
"phpcompatibility/phpcompatibility-wp": "^2.1"
5152
},
5253
"scripts": {
5354
"tests": "./vendor/bin/phpunit -c ./phpunit.xml.dist",
5455
"tests:coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit -c ./phpunit.xml.dist --coverage-html ./tests/coverage",
55-
"cs": "./vendor/bin/phpcs .",
56-
"cs:fix": "./vendor/bin/phpcbf .",
56+
"phpcs": "vendor/bin/phpcs .",
57+
"phpcbf": "./vendor/bin/phpcbf .",
5758
"phpstan": "./vendor/bin/phpstan analyse --memory-limit=1G",
5859
"qa": [
5960
"@cs",

0 commit comments

Comments
 (0)