Skip to content

Commit 50f1164

Browse files
committed
Add PHPCS
1 parent 8199941 commit 50f1164

File tree

4 files changed

+69
-4
lines changed

4 files changed

+69
-4
lines changed

.github/workflows/php.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@ jobs:
4141
if: steps.composer-cache.outputs.cache-hit != 'true'
4242
run: composer install --prefer-dist --no-progress --no-suggest
4343

44+
- name: Run phpcs
45+
run: composer run-script phpcs src
46+
4447
- name: Run phpunit
45-
run: ./vendor/bin/phpunit
48+
run: composer run-script test

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"guzzlehttp/guzzle": "^7.0.1"
1212
},
1313
"require-dev": {
14-
"phpunit/phpunit": "^8.5"
14+
"phpunit/phpunit": "^8.5",
15+
"squizlabs/php_codesniffer": "*"
1516
},
1617
"autoload": {
1718
"psr-4": {
@@ -28,6 +29,8 @@
2829
}
2930
},
3031
"scripts": {
31-
"test": "phpunit"
32+
"test": "phpunit",
33+
"phpcs": "phpcs",
34+
"phpcbf": "phpcbf"
3235
}
3336
}

composer.lock

Lines changed: 52 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="CodeMash.Php code standarts">
3+
<description>The coding standard for CodeMash PHP SDK project</description>
4+
<arg name="extensions" value="php"/>
5+
<arg value="p"/> <!-- progress -->
6+
<rule ref="PSR12">
7+
</rule>
8+
</ruleset>

0 commit comments

Comments
 (0)