jasny / jasny/phpdoc-parser

Example of how to render classes PHPDoc

オープン
#39 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
PHP
スター
41
フォーク
8
PR マージ指標
30日以内にマージされた PR はありません

説明

Hey Jasny,

Not really an issue, but wanted to share some code for those looking to get phpdoc for classes in an array.

This does get the default properties and methods available in the class provided. Could definitely use some tweaking

I didn't see any example on your site, so decided I may be able to figure it out. Now I'm seeing its going to take a lot longer than I expected to create markdown files from some classes with PHPDoc comments, but I might circle back around to it later.

```php
use Jasny\PhpdocParser\PhpdocParser;
use Jasny\PhpdocParser\Set\PhpDocumentor;
use Jasny\PhpdocParser\Tag\Summery;

include 'vendor/autoload.php';

$cls = new ReflectionClass('Jasny\PhpdocParser\PhpdocParser');
$doc = $cls->getDocComment();
$tags = PhpDocumentor::tags()->with([new Summery()]);
$parser = new PhpdocParser($tags);

$meta = $parser->parse($doc);

$foundProperties = $cls->getDefaultProperties();

$getMethods = $cls->getMethods();
$foundMethods = [];
foreach($getMethods as $methodAry){
$docMethod = $cls->getMethod($methodAry->name)->getDocComment();
$foundMethods[$methodAry->name] = $parser->parse($docMethod);
}

echo print_r($meta,1).PHP_EOL
.print_r($foundProperties,1).PHP_EOL
.print_r($foundMethods,1).PHP_EOL;
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

共有されている PHP の例を、特に ReflectionClass と PhpdocParser の設定について、プロジェクトに既にあるサイトの例と併せて確認します。ドキュメントの例が求められているか、また例がどこで管理されているかを確認します。クラスメタデータと解析済みの PHPDoc を示す、レビュー済みで保守されている例があれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
documentation
issue の種類
ドキュメント
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。