gossi/docblock 问题修复 & 功能扩展

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

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

gossi/docblock

最新稳定版本:v4.0

Composer 安装命令:

composer require gossi/docblock

包简介

PHP Docblock parser and generator. An API to read and write Docblocks.

README 文档

README

License Latest Stable Version Total Downloads Tests Coverage report Scrutinizer Code Quality Code Coverage

PHP Docblock parser and generator. An API to read and write Docblocks.

WARNING: starting from version 4.0 the library has moved to phpowermove organization and the namespace is phpowermove\docblock.

Installation

Install via Composer:

composer require phpowermove/docblock 

Usage

1. Generate a Docblock instance

a) Simple:

use phpowermove\docblock\Docblock; $docblock = new Docblock();

b) Create from string:

use phpowermove\docblock\Docblock; $docblock = new Docblock('/**  * Short Description.  *  * Long Description.  *  * @author gossi  */');

c) Create from reflection:

use phpowermove\docblock\Docblock; $docblock = new Docblock(new \ReflectionClass('MyClass'));

2. Manipulate tags

Get the tags:

$tags = $docblock->getTags();

Get tags by name:

$tags = $docblock->getTags('author');

Append a tag:

use phpowermove\docblock\tags\AuthorTag; $author = new AuthorTag(); $author->setName('gossi'); $docblock->appendTag($author);

or with fluent API:

use phpowermove\docblock\tags\AuthorTag; $docblock->appendTag(AuthorTag::create() ->setName('gossi') );

Check tag existence:

$docblock->hasTag('author');

3. Get back the string

Call toString():

$docblock->toString();

or if you are in a write-context, the magical __toString() will take care of it:

echo $docblock;

Documentation Api

See https://phpowermove.github.io/docblock

Contributing

Feel free to fork and submit a pull request (don't forget the tests) and I am happy to merge.

References

Changelog

Refer to Releases

统计信息

  • 总下载量: 408.03k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 3
  • 依赖项目数: 11
  • 推荐数: 0

GitHub 信息

  • Stars: 19
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固