theseer/phpdox
phpDox is a PHP documentation generator that builds API docs from your source code using reflection, tokens, and optional PHPDoc. It produces structured HTML output and integrates with PHPUnit coverage, offering configurable builds for libraries and apps.
phpdox aligns well with teams prioritizing self-documenting code via DocBlocks and XSD/XSLT-based output. Ideal for legacy PHP/Laravel monoliths where formal API docs (e.g., Swagger/OpenAPI) are absent or under-maintained.php vendor/bin/phpdox) or embedded in a custom Artisan command, making it non-intrusive.theseer/autoload updates).libxslt), which may need Docker/containerization for modern CI/CD.@method for dynamic methods) without custom rules.shallwebuildit/phpdoc) be preferable?phpdox be gated in PRs (e.g., via GitHub Actions) to enforce doc updates, or is it purely a post-release tool?phpDocumentor or Docz been evaluated for Laravel-specific features (e.g., route/queue worker docs)?barryvdh/laravel-ide-helper).App\Services) to validate output quality.@property tags).composer.json scripts):
"scripts": {
"docs": "php vendor/bin/phpdox -d src -t docs/output"
}
php artisan phpdox:generate --source=app --output=storage/docs
@route annotations).@property for model fields).phpdox plugins) for dynamic Laravel-specific placeholders.ext/xsl enabled).Illuminate\Container\Container from doc generation to avoid clutter.@ignore in DocBlocks for non-documentable classes.vendor/ in GitHub Actions to avoid redundant installs:
- uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
phpdox with --parse-only to identify missing/incorrect DocBlocks.Illuminate\Contracts).docs/ for traceability.@throws, @see).--profile).parallel-lint or split by module.| Risk | Impact | Mitigation |
|---|---|---|
| DocBlock Parsing Errors | Broken docs, false positives | Validate with phpstan/parse-analysis |
| XSLT Template Failures | Rendering errors in CI | Use docker-compose with libxslt |
| PHP Version Incompatibility | Build failures | Pin theseer/phpdox to a forked version |
| Stale Docs | Technical debt accumulation | Enforce docs in CONTRIBUTING.md |
phpDocumentor as reference).pre-commit checks for DocBlock syntax (e.g., via husky).phpdox --coverage).How can I help you explore Laravel packages today?