function BuilderHelpers::normalizeDocComment
Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc.
Parameters
Comment\Doc|string $docComment The doc comment to normalize:
Return value
Comment\Doc The normalized doc comment
4 calls to BuilderHelpers::normalizeDocComment()
- ClassConst::setDocComment in vendor/
nikic/ php-parser/ lib/ PhpParser/ Builder/ ClassConst.php - Sets doc comment for the constant.
- Declaration::setDocComment in vendor/
nikic/ php-parser/ lib/ PhpParser/ Builder/ Declaration.php - Sets doc comment for the declaration.
- EnumCase::setDocComment in vendor/
nikic/ php-parser/ lib/ PhpParser/ Builder/ EnumCase.php - Sets doc comment for the constant.
- Property::setDocComment in vendor/
nikic/ php-parser/ lib/ PhpParser/ Builder/ Property.php - Sets doc comment for the property.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ BuilderHelpers.php, line 286
Class
- BuilderHelpers
- This class defines helpers used in the implementation of builders. Don't use it directly.
Namespace
PhpParserCode
public static function normalizeDocComment($docComment) : Comment\Doc {
if ($docComment instanceof Comment\Doc) {
return $docComment;
}
if (is_string($docComment)) {
return new Comment\Doc($docComment);
}
throw new \LogicException('Doc comment must be a string or an instance of PhpParser\\Comment\\Doc');
}