Skip to content

Commit 88e5576

Browse files
authored
Update composer scripts (#755)
1 parent 1e01c7b commit 88e5576

File tree

6 files changed

+22
-9
lines changed

6 files changed

+22
-9
lines changed

.github/workflows/ci.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ jobs:
9696
composer install --no-interaction --prefer-dist --no-progress
9797
9898
- name: Run phpunit
99-
run: vendor/bin/phpunit
99+
run: composer test:ci

.github/workflows/cs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
run: composer update --no-progress --no-interaction --prefer-dist
2525

2626
- name: Run script
27-
run: composer phpcs
27+
run: composer phpcs:ci

.github/workflows/static-analysis.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
run: composer update --no-progress --no-interaction --prefer-dist
2525

2626
- name: Run script
27-
run: vendor/bin/phpstan analyse
27+
run: composer phpstan:ci

CONTRIBUTING.md

+8
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ Tests can be run via [PHPUnit](https://phpunit.de).
5454
composer tests
5555
```
5656

57+
### Static analysis
58+
59+
Static analysis can be run via [PHPStan](https://phpstan.org).
60+
61+
```bash
62+
composer phpstan
63+
```
64+
5765
### Code style
5866

5967
The code is automatically formatted through [php-cs-fixer](https://cs.symfony.com).

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ setup-git:
2020
phpcs:
2121
composer phpcs
2222

23+
.PHONY: phpstan
24+
phpstan:
25+
composer phpstan
26+
2327
.PHONY: tests
2428
tests:
2529
composer tests

composer.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@
4747
}
4848
},
4949
"scripts": {
50-
"phpcs": [
51-
"vendor/bin/php-cs-fixer fix --verbose --diff --dry-run"
52-
],
53-
"tests": [
54-
"vendor/bin/phpunit --verbose"
55-
]
50+
"test": "vendor/bin/phpunit",
51+
"tests": "@test",
52+
"test:ci": "vendor/bin/phpunit",
53+
"phpcs": "vendor/bin/php-cs-fixer fix",
54+
"phpcs:ci": "vendor/bin/php-cs-fixer fix --dry-run --diff",
55+
"phpstan": "vendor/bin/phpstan analyse",
56+
"phpstan:ci": "vendor/bin/phpstan analyse --error-format github"
5657
},
5758
"extra": {
5859
"branch-alias": {

0 commit comments

Comments
 (0)