@@ -194,8 +194,8 @@ protected function formatComments(?\phpDocumentor\Reflection\DocBlock $docBlock,
194
194
195
195
$ container = new \PHPFUI \Container ();
196
196
197
- $ container ->add ($ this ->parsedown ->text ($ this ->getInheritedSummary ($ docBlock , $ reflectionMethod )));
198
- $ desc = $ docBlock -> getDescription ( );
197
+ $ container ->add ($ this ->parsedown ->text ($ this ->getInheritedText ($ docBlock , $ reflectionMethod, ' getSummary ' )));
198
+ $ desc = $ this -> getInheritedText ( $ docBlock , $ reflectionMethod , ' getDescription ' );
199
199
200
200
if ($ desc )
201
201
{
@@ -382,18 +382,16 @@ protected function getComments(?\phpDocumentor\Reflection\DocBlock $docBlock, ?\
382
382
383
383
protected function getDocBlock ($ method ) : ?\phpDocumentor \Reflection \DocBlock
384
384
{
385
- /**
386
- * @todo get attributes everywhere
387
- * $attributes = $this->getAttributes($method);
388
- */
389
385
$ comments = $ method ->getDocComment ();
390
- $ comments = \str_ireplace ('{@inheritdoc} ' , '@inheritdoc ' , $ comments );
391
386
392
387
if (! $ comments )
393
388
{
394
389
return null ;
395
390
}
396
391
392
+ $ comments = \str_ireplace ('inheritdocs ' , 'inheritdoc ' , $ comments );
393
+ $ comments = \str_ireplace ('{@inheritdoc} ' , '@inheritdoc ' , $ comments );
394
+
397
395
try
398
396
{
399
397
$ docBlock = $ this ->factory ->create ($ comments );
@@ -414,9 +412,9 @@ protected function getHtmlClass(string $class) : string
414
412
return \str_replace ('\\' , '- ' , $ class );
415
413
}
416
414
417
- protected function getInheritedSummary (\phpDocumentor \Reflection \DocBlock $ docBlock , ?\ReflectionMethod $ reflectionMethod = null ) : string
415
+ protected function getInheritedText (\phpDocumentor \Reflection \DocBlock $ docBlock , ?\ReflectionMethod $ reflectionMethod = null , string $ textType = ' getDescription ' ) : string
418
416
{
419
- $ summary = $ docBlock ->getSummary ();
417
+ $ summary = $ docBlock ->{ $ textType } ();
420
418
421
419
if (! $ reflectionMethod )
422
420
{
@@ -429,7 +427,7 @@ protected function getInheritedSummary(\phpDocumentor\Reflection\DocBlock $docBl
429
427
{
430
428
$ pos = \stripos ($ tag ->getName (), 'inheritdoc ' );
431
429
432
- if (false !== $ pos && 0 > = $ pos )
430
+ if (false !== $ pos && 0 < = $ pos )
433
431
{
434
432
$ reflectionClass = $ reflectionMethod ->getDeclaringClass ();
435
433
$ parent = $ reflectionClass ->getParentClass ();
@@ -451,7 +449,7 @@ protected function getInheritedSummary(\phpDocumentor\Reflection\DocBlock $docBl
451
449
452
450
if ($ docBlock )
453
451
{
454
- return $ summary . "\n" . $ this ->getInheritedSummary ($ docBlock , $ method) ;
452
+ return $ this ->getInheritedText ($ docBlock , $ method, $ textType ) . $ summary ;
455
453
}
456
454
}
457
455
$ parent = $ parent ->getParentClass ();
0 commit comments