mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Added parsed inline tags.
This commit is contained in:
@@ -27,6 +27,9 @@ class LongDescription implements \Reflector
|
|||||||
/** @var \phpDocumentor\Reflection\DocBlock\Tags[] */
|
/** @var \phpDocumentor\Reflection\DocBlock\Tags[] */
|
||||||
protected $tags = array();
|
protected $tags = array();
|
||||||
|
|
||||||
|
/** @var array The contents, as an array of strings and Tag objects. */
|
||||||
|
protected $parsedContents = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses the string for inline tags and if the Markdown class is included;
|
* Parses the string for inline tags and if the Markdown class is included;
|
||||||
* format the found text.
|
* format the found text.
|
||||||
@@ -35,11 +38,11 @@ class LongDescription implements \Reflector
|
|||||||
*/
|
*/
|
||||||
public function __construct($content)
|
public function __construct($content)
|
||||||
{
|
{
|
||||||
if (preg_match('/\{\@(.+?)\}/u', $content, $matches)) {
|
$this->parsedContents = preg_split('/{\@(.+?)\}/uS', $content, null, PREG_SPLIT_DELIM_CAPTURE);
|
||||||
array_shift($matches);
|
for ($i=1, $l = count($this->parsedContents); $i<$l; $i += 2) {
|
||||||
foreach ($matches as $tag) {
|
$this->parsedContents[$i] = $this->tags[] = Tag::createInstance(
|
||||||
$this->tags[] = Tag::createInstance('@' . $tag);
|
'@' . $this->parsedContents[$i]
|
||||||
}
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->contents = trim($content);
|
$this->contents = trim($content);
|
||||||
@@ -55,6 +58,11 @@ class LongDescription implements \Reflector
|
|||||||
return $this->contents;
|
return $this->contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getParsedContents()
|
||||||
|
{
|
||||||
|
return $this->parsedContents;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a formatted variant of the Long Description using MarkDown.
|
* Return a formatted variant of the Long Description using MarkDown.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user