Skip to content

Commit 46b06a5

Browse files
committed
Update README.md and update scripts in composer.json.
1 parent 9e3dc1b commit 46b06a5

File tree

3 files changed

+66
-20
lines changed

3 files changed

+66
-20
lines changed

README.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<p align="center">
2-
<a href="https://github.com/yiisoft" target="_blank">
3-
<img src="https://avatars0.githubusercontent.com/u/993323" height="100px">
4-
</a>
2+
<picture>
3+
<source media="(prefers-color-scheme: dark)" srcset="https://www.yiiframework.com/image/yii_logo_light.svg">
4+
<source media="(prefers-color-scheme: light)" srcset="https://www.yiiframework.com/image/yii_logo_dark.svg">
5+
<img src="https://www.yiiframework.com/image/yii_logo_dark.svg" alt="Yii Framework" height="100px">
6+
</picture>
57
<h1 align="center">Yii 2 Basic Project Template</h1>
68
<br>
79
</p>
@@ -206,21 +208,9 @@ vendor/bin/codecept run Functional,Unit --coverage --coverage-html --coverage-xm
206208

207209
You can see code coverage output under the `tests/Support/output` directory.
208210

209-
## Composer scripts
211+
## Documentation
210212

211-
```
212-
# run all tests
213-
composer tests
214-
215-
# run static analysis
216-
composer static
217-
218-
# run phpcs
219-
composer phpcs
220-
221-
# run phpcbf
222-
composer phpcbf
223-
```
213+
- [Internals](docs/internals.md)
224214

225215
## Support the project
226216

@@ -229,6 +219,6 @@ composer phpcbf
229219
## Follow updates
230220

231221
[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=for-the-badge&logo=yii)](https://www.yiiframework.com/)
232-
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?style=for-the-badge&logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
222+
[![Follow on X](https://img.shields.io/badge/-Follow%20on%20X-1DA1F2.svg?style=for-the-badge&logo=x&logoColor=white&labelColor=000000)](https://x.com/yiiframework)
233223
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=for-the-badge&logo=telegram)](https://t.me/yii_framework_in_english)
234224
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=for-the-badge&logo=slack)](https://yiiframework.com/go/slack)

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
}
4747
},
4848
"scripts": {
49-
"phpcbf": "./vendor/bin/phpcbf -q assets/ commands/ controllers/ mail/ models/ tests/",
50-
"phpcs": "./vendor/bin/phpcs -q assets/ commands/ controllers/ mail/ models/ tests/",
49+
"cs": "./vendor/bin/phpcs -q assets/ commands/ controllers/ mail/ models/ tests/",
50+
"cs-fix": "./vendor/bin/phpcbf -q assets/ commands/ controllers/ mail/ models/ tests/",
5151
"post-install-cmd": [
5252
"yii\\composer\\Installer::postInstall"
5353
],

docs/internals.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Testing
2+
3+
This package provides a consistent set of [Composer](https://getcomposer.org/) scripts for local validation.
4+
5+
Tool references:
6+
7+
- [Codeception](https://codeception.com/) for unit tests.
8+
- [PHPCodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) for code style checks.
9+
- [PHPStan](https://phpstan.org/) for static analysis.
10+
- [PHPUnit](https://phpunit.de/) for unit tests.
11+
12+
## Code style checks (PHPCodeSniffer)
13+
14+
Run code style checks.
15+
16+
```bash
17+
composer cs
18+
```
19+
20+
Fix code style issues.
21+
22+
```bash
23+
composer cs-fix
24+
```
25+
26+
## Static analysis (PHPStan)
27+
28+
Run static analysis.
29+
30+
```bash
31+
composer static
32+
```
33+
34+
## Unit tests (Codeception)
35+
36+
Run the full test suite.
37+
38+
```bash
39+
composer tests
40+
```
41+
42+
## Passing extra arguments
43+
44+
Composer scripts support forwarding additional arguments using `--`.
45+
46+
Run Codeception with a specific suite.
47+
48+
```bash
49+
composer tests -- Acceptance
50+
```
51+
52+
Run PHPStan with a different memory limit.
53+
54+
```bash
55+
composer static -- --memory-limit=512M
56+
```

0 commit comments

Comments
 (0)