mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
Compare commits
7
Commits
1.0.0-beta6
..
1.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c999e7d32a | ||
|
|
2b05ea3221 | ||
|
|
33a2e55cbc | ||
|
|
3d97a72bac | ||
|
|
51210b581e | ||
|
|
cee3c0bc21 | ||
|
|
731e797dd8 |
@@ -99,7 +99,7 @@ class DocBlock implements \Reflector
|
||||
{
|
||||
$comment = trim(
|
||||
preg_replace(
|
||||
'#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#', '$1', $comment
|
||||
'#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', '$1', $comment
|
||||
)
|
||||
);
|
||||
|
||||
@@ -133,7 +133,7 @@ class DocBlock implements \Reflector
|
||||
} else {
|
||||
// clears all extra horizontal whitespace from the line endings
|
||||
// to prevent parsing issues
|
||||
$comment = preg_replace('~(?m)\h*$~', '', $comment);
|
||||
$comment = preg_replace('~(?m)\h*$~u', '', $comment);
|
||||
|
||||
/*
|
||||
* Splits the docblock into a short description, long description and
|
||||
@@ -173,7 +173,7 @@ class DocBlock implements \Reflector
|
||||
)
|
||||
)?
|
||||
(\s+ [\s\S]*)? # everything that follows
|
||||
/', $comment, $matches
|
||||
/u', $comment, $matches
|
||||
);
|
||||
array_shift($matches);
|
||||
}
|
||||
@@ -330,7 +330,7 @@ class DocBlock implements \Reflector
|
||||
}
|
||||
|
||||
$namespace = '';
|
||||
if ($this->namespace != 'default') {
|
||||
if ($this->namespace != 'default' && $this->namespace != 'global') {
|
||||
$namespace = rtrim($this->namespace, '\\') . '\\';
|
||||
}
|
||||
|
||||
@@ -350,21 +350,12 @@ class DocBlock implements \Reflector
|
||||
) {
|
||||
$type_parts = explode('\\', $item);
|
||||
|
||||
// if the first part is the keyword 'namespace', replace it
|
||||
// with the current namespace
|
||||
if ($type_parts[0] == 'namespace') {
|
||||
$type_parts[0] = $this->getNamespace();
|
||||
$item = implode('\\', $type_parts);
|
||||
}
|
||||
|
||||
// if the first segment is an alias; replace with full name
|
||||
if (isset($this->namespace_aliases[$type_parts[0]])) {
|
||||
$type_parts[0] = $this->namespace_aliases[$type_parts[0]];
|
||||
|
||||
$item = implode('\\', $type_parts);
|
||||
} elseif (count($type_parts) == 1) {
|
||||
// prefix the item with the namespace if there is only one
|
||||
// part and no alias
|
||||
} else {
|
||||
// otherwise prepend the current namespace
|
||||
$item = $namespace . $item;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class LongDescription implements \Reflector
|
||||
*/
|
||||
public function __construct($content)
|
||||
{
|
||||
if (preg_match('/\{\@(.+?)\}/', $content, $matches)) {
|
||||
if (preg_match('/\{\@(.+?)\}/u', $content, $matches)) {
|
||||
array_shift($matches);
|
||||
foreach ($matches as $tag) {
|
||||
$this->tags[] = Tag::createInstance('@' . $tag);
|
||||
@@ -78,7 +78,7 @@ class LongDescription implements \Reflector
|
||||
);
|
||||
}
|
||||
|
||||
if (class_exists('\dflydev\markdown\MarkdownExtraParser')) {
|
||||
if (class_exists('dflydev\markdown\MarkdownExtraParser')) {
|
||||
$md = new \dflydev\markdown\MarkdownExtraParser();
|
||||
$result = $md->transformMarkdown($result);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class ParamTag extends Tag
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
return $this->docblock->expandType($this->type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user