Skip to content

Commit 3c4f067

Browse files
committed
Include phpcs as dev dependency and run on PHP 8.0
1 parent d8d9f8a commit 3c4f067

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

.github/workflows/static.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,28 @@ jobs:
1717
args: analyze --no-progress
1818

1919
phpcs:
20-
name: PHPCS
20+
name: PHP CodeSniffer
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout code
2424
uses: actions/checkout@v2
2525

26-
- name: Download dependencies
27-
run: composer update --no-interaction --prefer-dist --no-progress --no-suggest --dev
26+
- name: Setup PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: 8.0
30+
tools: composer:v2, cs2pr
31+
coverage: none
2832

29-
- name: PHPCS check
30-
uses: chekalsky/phpcs-action@v1
33+
- name: Cache Composer dependencies
34+
uses: actions/cache@v2
3135
with:
32-
phpcs_bin_path: './vendor/bin/phpcs'
36+
path: ~/.composer/cache
37+
key: php-composer-locked-${{ hashFiles('composer.lock') }}
38+
restore-keys: php-composer-locked-
39+
40+
- name: Install dependencies
41+
run: composer install --no-interaction --prefer-dist --no-progress
42+
43+
- name: PHP CS
44+
run: vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,19 @@
2828
"mnapoli/hard-mode": "^0.3.0",
2929
"phpstan/phpstan": "^0.12.0",
3030
"symfony/filesystem": "^5.0|^6.0",
31-
"symfony/process": "^5.0|^6.0"
31+
"symfony/process": "^5.0|^6.0",
32+
"squizlabs/php_codesniffer": "^3.6"
3233
},
3334
"extra": {
3435
"laravel": {
3536
"providers": [
3637
"Bref\\LaravelBridge\\BrefServiceProvider"
3738
]
3839
}
40+
},
41+
"config": {
42+
"allow-plugins": {
43+
"dealerdirect/phpcodesniffer-composer-installer": true
44+
}
3945
}
4046
}

0 commit comments

Comments
 (0)