承接 podlove/comment-introspection 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

podlove/comment-introspection

Composer 安装命令:

composer require podlove/comment-introspection

包简介

PHP library providing a toolkit to parse class and method comments.

README 文档

README

Build Status

PHP library providing a toolkit to parse class and method comments.

Usage

use Podlove\Comment\Comment;

class ExampleClass {

    /**
     * A Title
     *
     * A multiline
     * description.
     * 
     * @tag1
     * @tag2 tag2 description
     */
    public function foo() {
        return "bar";
    }
}

$reflectionClass = new ReflectionClass("ExampleClass");
$methods = $reflectionClass->getMethods();
$parsedMethods = array_map(function($method) {
    $c = new Comment($method->getDocComment());
    $c->parse();

    return [
        'methodname'  => $method->name,
        'title'       => $c->getTitle(),
        'description' => $c->getDescription(),
        'tags'        => $c->getTags()
        /**
         * You can also access specific tags like so:
         * $c->getTag('tag1') or
         * $c->getTags('param') if you use one tag multiple times
         */
    ];
}, $methods);
print_r($parsedMethods);

/* =>

Array
(
    [0] => Array
        (
            [methodname] => foo
            [title] => A Title
            [description] => A multiline
description.

            [tags] => Array
                (
                    [0] => Array
                        (
                            [name] => tag2
                            [description] => tag2 description
                            [line] => 6
                        )

                    [1] => Array
                        (
                            [name] => tag1
                            [description] =>
                            [line] => 5
                        )

                )

        )

)
*/

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固