Skip to content

Commit 2bd0e49

Browse files
docs: improve documentation generation instructions (#789)
Closes #788 As mentioned in [PR #772](#772), contributors need clearer guidance on when and why to regenerate documentation. This PR addresses [issue #788](#788). 1. Add `composer docs` command for easier doc generation 2. Update CONTRIBUTING.md to clearly explain when/why you need to regenerate and commit This should help prevent CI failures by making the documentation requirements more explicit.
1 parent adaebbd commit 2bd0e49

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,17 @@ We use [phpDocumentor](https://www.phpdoc.org/) to generate API documentation.
6868
**Please make sure your new or modified code is covered by proper PHPDoc comments.**
6969
Good documentation ensures that contributors and users can easily read and understand how the methods and classes work.
7070

71-
To generate documentation locally, make sure phpDocumentor is installed, then run:
71+
**Important:** You **must** regenerate and commit the documentation after modifying code in `src/` or merging from `master`. The CI will fail if documentation is out of sync.
7272

73+
To generate documentation locally, run:
74+
75+
```bash
76+
$ composer docs
7377
```
78+
79+
Or manually:
80+
81+
```bash
7482
$ wget https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.8.1/phpDocumentor.phar
7583
$ php phpDocumentor.phar run -d src -t docs
7684
```

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"md": "phpmd --ignore-violations-on-exit src/constants,src/laravel,src/parser,examples/EchoBot/src,examples/EchoBot/public,examples/KitchenSink/src,examples/KitchenSink/public text phpmd.xml",
5353
"stan": "phpstan analyse",
5454
"copyright": "tools/check_copyright.sh",
55+
"docs": "bash -c '[ -f phpDocumentor.phar ] || curl -L -o phpDocumentor.phar https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.8.1/phpDocumentor.phar; php phpDocumentor.phar run -d src -t docs'",
5556
"check": [
5657
"@test",
5758
"@cs",

0 commit comments

Comments
 (0)