phpDocumentor / phpDocumentor/ReflectionDocBlock
Inline tag handling with nested braces is not working as expected
オープン
まだ誰も着手していません。
bug
help wanted
- 主要言語
- PHP
- スター
- 9.4k
- フォーク
- 137
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 1
説明
Given the following test case, our Description doesn't work as expected with nested braces in inline tags.
/**
* @uses \phpDocumentor\Reflection\DocBlock\Description
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Link
* @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
* @uses \phpDocumentor\Reflection\Types\Context
*
* @covers ::__construct
* @covers ::create
*/
public function testDescriptionCanParseStringWithInlineTagAndBraces() : void
{
$contents = 'This description has a {@link http://phpdoc.org/ This contains {braces} }';
$context = new Context('');
$tagFactory = m::mock(TagFactory::class);
$tagFactory->shouldReceive('create')
->twice()
->andReturnValues(
[
new LinkTag('http://phpdoc.org/', new Description('This contains {braces}')),
]
);
$factory = new DescriptionFactory($tagFactory);
$description = $factory->create($contents, $context);
$this->assertSame($contents, $description->render());
$this->assertSame('This description has a %1$s', $description->getBodyTemplate());
}
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Issue に示されている DescriptionFactory とテストメソッド testDescriptionCanParseStringWithInlineTagAndBraces を見つけます。説明に入れ子になった波括弧が含まれる場合に、inline {@link ...} の内容がどのように解析されるかを追跡します。提供されたアサーションが通り、レンダリングされた内容と期待される body template が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- documentation
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100