phpDocumentor / phpDocumentor/ReflectionDocBlock
Inline tag handling with nested braces is not working as expected
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- PHP
- Sterne
- 9.4k
- Forks
- 137
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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());
}
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, DescriptionFactory und die im Issue gezeigte Testmethode testDescriptionCanParseStringWithInlineTagAndBraces zu finden. Verfolge, wie der Inhalt von {@link ...} geparst wird, wenn die Beschreibung verschachtelte geschweifte Klammern enthält. Als erledigt gilt die Aufgabe, wenn die bereitgestellten Assertions erfolgreich sind und dabei die gerenderten Inhalte sowie das erwartete Body-Template erhalten bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- php
- Bereich
- documentation
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100