Skip to content

Commit 6473970

Browse files
committed
add composer commands to fix code style
1 parent 25f3d11 commit 6473970

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,29 @@ Change the factory class in `config/queue.php`:
169169
## Testing
170170

171171
Setup RabbitMQ using `docker-compose`:
172+
172173
```bash
173174
docker-compose up -d
174175
```
175176

176-
Run tests:
177+
To run the test suite you can use the following commands:
177178

178-
``` bash
179+
```bash
180+
# To run both style and unit tests.
179181
composer test
182+
183+
# To run only style tests.
184+
composer test:style
185+
186+
# To run only unit tests.
187+
composer test:unit
188+
```
189+
190+
If you receive any errors from the style tests, you can automatically fix most,
191+
if not all of the issues with the following command:
192+
193+
```bash
194+
composer fix:style
180195
```
181196

182197
## Contribution

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@
4646
}
4747
},
4848
"scripts": {
49-
"test": "vendor/bin/phpunit"
49+
"test": [
50+
"@test:style",
51+
"@test:unit"
52+
],
53+
"test:style": "@php vendor/bin/php-cs-fixer fix --config=.php_cs.dist --allow-risky=yes --dry-run --diff --verbose",
54+
"test:unit": "@php vendor/bin/phpunit",
55+
"fix:style": "@php vendor/bin/php-cs-fixer fix --config=.php_cs.dist --allow-risky=yes --diff --verbose"
5056
},
5157
"minimum-stability": "dev",
5258
"prefer-stable": true

0 commit comments

Comments
 (0)