thecichos/auto-documentation 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thecichos/auto-documentation

Composer 安装命令:

composer require thecichos/auto-documentation

包简介

Automatic API and code documentation generation using PHPdocs

README 文档

README

This documentation was autogenerated using this tool

Table of Contents

Types

Type Reference

PropertyInfo {#type-property-info}

Represents metadata about a class property for documentation purposes

Fully Qualified Name: AutoDocumentation\Generator\PropertyInfo

Properties:

Visibility Property Type Description
Public name string The name of the property
Public type string The type of the property as a string
Public nullable bool Whether the property can be null
Public description string Human-readable description of the property
Public example ?mixed Example value for the property
Public deprecated bool Whether the property is deprecated
Public accessibility Accessibility Visibility level of the property

TypeInfo {#type-type-info}

Represents metadata about a class or interface for documentation purposes

Fully Qualified Name: AutoDocumentation\Generator\TypeInfo

Properties:

Visibility Property Type Description
Public fqcn string Fully qualified class name of the type
Public shortName string Short class name without namespace
Public slug string URL-friendly identifier for the type
Public group string Category group for organizing types in documentation
Public description string Human-readable description of the type
Public properties array List of property definitions for this type
Public methods array List of method definitions for this type

Methods:

Visibility Method Description Returns
Public getAnchor() Returns a Markdown anchor for this type string
Public getUrl() Returns a URL for this type in the documentation string

TypeRegistry {#type-type-registry}

Registry for tracking documented types and resolving type links

Fully Qualified Name: AutoDocumentation\Generator\TypeRegistry

Properties:

Visibility Property Type Description
Private types array<class-string,

Methods:

Visibility Method Description Returns
Public register() Registers a class for documentation. Extracts metadata from PHPDoc comments. PHPDoc tags supported on classes: - @slug custom-slug (URL-friendly identifier) - @group GroupName (category for grouping in docs) - Description from the docblock summary void
Public resolve() Resolves a type by its fully-qualified class name or short name TypeInfo
Public isLinkable() Checks whether a type name can be linked in documentation bool
Public getAll() array<class-string,
Public getAllGrouped() array<string,

MethodParamInfo {#type-method-param-info}

Represents metadata about a method parameter for documentation purposes

Fully Qualified Name: AutoDocumentation\Generator\MethodParamInfo

Properties:

Visibility Property Type Description
Public name string The name of the parameter
Public type array The type of the parameter as an array of strings
Public nullable bool Whether the parameter can be null
Public hasDefault bool Whether the parameter has a default value
Public default ?mixed The default value of the parameter, or null if none

Accessibility {#type-accessibility}

Enum that makes it more streamlined to handle accessibility rules

Fully Qualified Name: AutoDocumentation\Generator\Accessibility

Properties:

Visibility Property Type Description
Public name string
Public value int

Methods:

Visibility Method Description Returns
Public html() string
Public cases() array
Public from() Accessibility
Public tryFrom() Accessibility

DocGenerator {#type-doc-generator}

Handles extraction of types, methods and endpoints

Fully Qualified Name: AutoDocumentation\Generator\DocGenerator

Properties:

Visibility Property Type Description
Private registry TypeRegistry

Methods:

Visibility Method Description Returns
Public generate() array

MethodInfo {#type-method-info}

Represents metadata about a method for documentation purposes

Fully Qualified Name: AutoDocumentation\Generator\MethodInfo

Properties:

Visibility Property Type Description
Public name string The name of the method
Public description string A description of the method
Public parameters array An array of MethodParamInfo objects representing the parameters of the method
Public returnType ??string The return type of the method as a string
Public returnDescription ??string A description of the return value of the method
Public example ??string An example of how to use the method
Public deprecated bool Whether the method is deprecated
Public isStatic bool Whether the method is static
Public accessibility Accessibility The accessibility of the method

TypeRenderer {#type-type-renderer}

Renders PHP type information as HTML or markdown with links to documented types

Fully Qualified Name: AutoDocumentation\Generator\TypeRenderer

Properties:

Visibility Property Type Description
Private registry TypeRegistry

Methods:

Visibility Method Description Returns
Public render() Renders a ReflectionType as an HTML string, handling union, intersection, and named types string
Public renderFromString() Renders a type from its string representation Supports nullable, arrays, generics, and unions string

AutoDocumentation {#type-auto-documentation}

Main class for generating API documentation

Fully Qualified Name: AutoDocumentation\AutoDocumentation

Properties:

Visibility Property Type Description
Private registry TypeRegistry
Private generator DocGenerator
Private htmlRenderer AutoDocumentation\Renderer\HtmlRenderer
Private jsonRenderer AutoDocumentation\Renderer\JsonRenderer
Private markdownRenderer AutoDocumentation\Renderer\MDRenderer
Private controllers class-string[]

Methods:

Visibility Method Description Returns
Public registerTypes() Register model/DTO classes that should be linkable in documentation AutoDocumentation
Public registerControllers() Register API controller classes to document AutoDocumentation
Public scanTypesDirectory() Scan a directory for documentable types (models/DTOs) AutoDocumentation
Public scanControllersDirectory() Scan a directory for API controllers AutoDocumentation
Public generate() Generate raw documentation array array
Public toHtml() Render documentation as HTML string
Public toOpenApi() Render documentation as OpenAPI 3.0 JSON string
Public toMarkdown() string
Public saveHtml() Save HTML documentation to file AutoDocumentation
Public saveOpenApi() Save OpenAPI JSON to file AutoDocumentation
Public saveMarkdown() AutoDocumentation
Public getRegistry() Get the type registry for advanced usage TypeRegistry

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-06