You are here

protected function DocBlock::cleanInput in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php \phpDocumentor\Reflection\DocBlock::cleanInput()

Strips the asterisks from the DocBlock comment.

Parameters

string $comment String containing the comment text.:

Return value

string

1 call to DocBlock::cleanInput()
DocBlock::__construct in vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php
Parses the given docblock and populates the member fields.

File

vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock.php, line 108

Class

DocBlock
Parses the DocBlock for any structure.

Namespace

phpDocumentor\Reflection

Code

protected function cleanInput($comment) {
  $comment = trim(preg_replace('#[ \\t]*(?:\\/\\*\\*|\\*\\/|\\*)?[ \\t]{0,1}(.*)?#u', '$1', $comment));

  // reg ex above is not able to remove */ from a single line docblock
  if (substr($comment, -2) == '*/') {
    $comment = trim(substr($comment, 0, -2));
  }

  // normalize strings
  $comment = str_replace(array(
    "\r\n",
    "\r",
  ), "\n", $comment);
  return $comment;
}