function DocBlockFactory::stripDocComment
Strips the asterisks from the DocBlock comment.
Parameters
string $comment String containing the comment text.:
1 call to DocBlockFactory::stripDocComment()
- DocBlockFactory::create in vendor/
phpdocumentor/ reflection-docblock/ src/ DocBlockFactory.php
File
-
vendor/
phpdocumentor/ reflection-docblock/ src/ DocBlockFactory.php, line 166
Class
Namespace
phpDocumentor\ReflectionCode
private function stripDocComment(string $comment) : string {
$comment = preg_replace('#[ \\t]*(?:\\/\\*\\*|\\*\\/|\\*)?[ \\t]?(.*)?#u', '$1', $comment);
Assert::string($comment);
$comment = trim($comment);
// reg ex above is not able to remove */ from a single line docblock
if (substr($comment, -2) === '*/') {
$comment = trim(substr($comment, 0, -2));
}
return str_replace([
"\r\n",
"\r",
], "\n", $comment);
}