@@ -413,39 +413,39 @@ private function getComment(BaseNode $node): string
413413 {
414414 $ comment = '' ;
415415 if ('' !== $ info = (string ) $ node ->getInfo ()) {
416- $ comment .= ' * ' . $ info ."\n" ;
416+ $ comment .= $ info ."\n" ;
417417 }
418418
419419 if (!$ node instanceof ArrayNode) {
420420 foreach ((array ) ($ node ->getExample () ?? []) as $ example ) {
421- $ comment .= ' * @example ' .$ example ."\n" ;
421+ $ comment .= '@example ' .$ example ."\n" ;
422422 }
423423
424424 if ('' !== $ default = $ node ->getDefaultValue ()) {
425- $ comment .= ' * @default ' .(null === $ default ? 'null ' : var_export ($ default , true ))."\n" ;
425+ $ comment .= '@default ' .(null === $ default ? 'null ' : var_export ($ default , true ))."\n" ;
426426 }
427427
428428 if ($ node instanceof EnumNode) {
429- $ comment .= sprintf (' * @param ParamConfigurator|%s $value ' , implode ('| ' , array_unique (array_map (fn ($ a ) => !$ a instanceof \UnitEnum ? var_export ($ a , true ) : '\\' .ltrim (var_export ($ a , true ), '\\' ), $ node ->getValues ()))))."\n" ;
429+ $ comment .= sprintf ('@param ParamConfigurator|%s $value ' , implode ('| ' , array_unique (array_map (fn ($ a ) => !$ a instanceof \UnitEnum ? var_export ($ a , true ) : '\\' .ltrim (var_export ($ a , true ), '\\' ), $ node ->getValues ()))))."\n" ;
430430 } else {
431431 $ parameterTypes = $ this ->getParameterTypes ($ node );
432- $ comment .= ' * @param ParamConfigurator| ' .implode ('| ' , $ parameterTypes ).' $value ' ."\n" ;
432+ $ comment .= '@param ParamConfigurator| ' .implode ('| ' , $ parameterTypes ).' $value ' ."\n" ;
433433 }
434434 } else {
435435 foreach ((array ) ($ node ->getExample () ?? []) as $ example ) {
436- $ comment .= ' * @example ' .json_encode ($ example )."\n" ;
436+ $ comment .= '@example ' .json_encode ($ example )."\n" ;
437437 }
438438
439439 if ($ node ->hasDefaultValue () && [] != $ default = $ node ->getDefaultValue ()) {
440- $ comment .= ' * @default ' .json_encode ($ default )."\n" ;
440+ $ comment .= '@default ' .json_encode ($ default )."\n" ;
441441 }
442442 }
443443
444444 if ($ node ->isDeprecated ()) {
445- $ comment .= ' * @deprecated ' .$ node ->getDeprecation ($ node ->getName (), $ node ->getParent ()->getName ())['message ' ]."\n" ;
445+ $ comment .= '@deprecated ' .$ node ->getDeprecation ($ node ->getName (), $ node ->getParent ()->getName ())['message ' ]."\n" ;
446446 }
447447
448- return $ comment ;
448+ return $ comment ? ' * ' . str_replace ( "\n" , "\n * " , rtrim ( $ comment , "\n" )). "\n" : '' ;
449449 }
450450
451451 /**
0 commit comments