Download the PHP package julien-boudry/php-reference without Composer
On this page you can find all versions of the php package julien-boudry/php-reference. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download julien-boudry/php-reference
More information about julien-boudry/php-reference
Files in julien-boudry/php-reference
Package php-reference
Short Description A PHP documentation generator that analyzes namespaces using reflection and generates comprehensive Markdown documentation with cross-references
License BSD-3-Clause
Informations about the package php-reference
PhpReference
Main Author: Julien Boudry
License: say hello if you like or use this code!
Donation: ₿ bc1q3jllk3qd9fjvvuqy07tawkv7t6h7qjf55fc2gh or GitHub Sponsor Page
PhpReference is a powerful documentation generator for PHP projects. It analyzes your codebase using reflection and generates comprehensive Markdown documentation for your namespaces, classes, methods, properties, and constants.
Workflow
- Automatic Documentation Generation - Analyzes PHP namespaces using reflection to extract classes, methods, properties, constants, and their metadata
- PHPDoc Integration - Parses and renders PHPDoc blocks including descriptions, parameters, return types, and custom tags
- Cross-Referencing - Generates internal links between classes, methods, and properties
- Public API Focus - Control what gets documented using
@apitags or visibility rules - Markdown Output - Clean, readable documentation in Markdown format ready for GitHub, GitLab, or your documentation site
Features
- Full Reflection Analysis - Classes, interfaces, traits, enums, methods, properties, constants
- PHPDoc Parsing - Descriptions,
@param,@return,@throws,@see, custom tags - Type Resolution - Automatic linking to documented types
- Cross-References - Internal links between elements
- Inheritance Tracking - Shows declaring class for inherited members
- Custom Public API Rules - Define what gets documented
- Source Links - Optional links back to source code
- Configuration File Support - Set your preferences once in
reference.phpand run without arguments
Quick Start
Installation
Install PhpReference via Composer:
Recommended: Using a Configuration File
The recommended way to use PhpReference is with a configuration file. This avoids typing the same arguments repeatedly and makes your documentation setup reproducible.
Create a reference.php file at your project root:
Then simply run:
📖 Full Configuration Documentation - Learn about all available options, priority rules, and advanced usage.
Note: If you're working on the PhpReference project itself, use
php bin/php-referenceinstead ofphp vendor/bin/php-reference.
Quick Start Without Configuration
For a quick one-time generation, you can use command-line arguments:
💡 Tip: While command-line arguments work well for testing, using a configuration file is recommended for regular use and CI/CD pipelines.
Command-Line Options
| Option | Shortcut | Description | Example |
|---|---|---|---|
namespace |
- | Namespace to analyze (optional if set in config) | MyNamespace\\MyProject |
--output |
-o |
Output directory | --output=./docs/api |
--append |
-a |
Do not clean output directory before generation | --append |
--api |
- | API definition to use (HasTagApi, IsPubliclyAccessible) |
--api=IsPubliclyAccessible |
--index-file-name |
- | Name of the index file (without extension) | --index-file-name=index |
--source-url-base |
- | Base URL for source code links | --source-url-base=https://github.com/user/repo/blob/main |
--config |
-c |
Path to configuration file | --config=./my-config.php |
💡 Remember: Command-line arguments override configuration file settings. For regular use, prefer using a configuration file and only override specific options when needed.
Common Use Cases
Development Workflow
Once you have a reference.php configuration file, your workflow becomes simple:
CI/CD Integration
Using a configuration file makes CI/CD integration straightforward:
No need to specify arguments in your workflow file - everything is configured in reference.php.
Multiple Documentation Targets
Generate different documentation sets using different config files:
Public API Control
PhpReference lets you control what gets documented:
Using @api Tags (Default)
Mark elements for documentation with the @api PHPDoc tag:
Include All Public Elements
Use --api=IsPubliclyAccessible to document all public classes, methods, and properties regardless of @api tags:
Available API Definitions
HasTagApi(default): Only elements marked with@apitagIsPubliclyAccessible: All public elements
Output Structure
PhpReference generates a structured documentation hierarchy:
Requirements
- PHP 8.4 or higher
- Composer for dependency management
Contributing
Contributions are welcome! See CONTRIBUTING.md for development setup and guidelines.
Credits
Created and maintained by Julien Boudry.
If you find this project useful, please consider:
- ⭐ Starring the repository
- 💬 Sharing your use case
- 💝 Sponsoring the project
All versions of php-reference with dependencies
phpdocumentor/reflection-docblock Version ^6.0
latte/latte Version ^3.1
league/flysystem Version ^3.29
symfony/console Version ^8.0
laravel/prompts Version ^0.3
phpunit/php-timer Version ^8.0
nikic/php-parser Version ^5.7