mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
Compare commits
8
Commits
6.x
...
1.0.0-beta5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f8cbd9ab6 | ||
|
|
a5b50ba482 | ||
|
|
f0a2901e56 | ||
|
|
bc982b7d51 | ||
|
|
b892415ca3 | ||
|
|
37a1ac2e19 | ||
|
|
0b096ce2e7 | ||
|
|
5aea3269e1 |
@@ -19,7 +19,7 @@ Installation
|
|||||||
You can install the component in the following ways:
|
You can install the component in the following ways:
|
||||||
|
|
||||||
* Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock)
|
* Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock)
|
||||||
* Via composer (add the Github Repository as VCS repository in your composer.yml)
|
* Via Composer (http://packagist.org/packages/phpdocumentor/reflection-docblock)
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|||||||
@@ -127,11 +127,11 @@ class DocBlock implements \Reflector
|
|||||||
preg_match(
|
preg_match(
|
||||||
'/(?x)
|
'/(?x)
|
||||||
\A (
|
\A (
|
||||||
[^\n]+
|
[^\n.]+
|
||||||
(?:
|
(?:
|
||||||
(?! (?<=\.) \n | \n{2} ) # disallow the first seperator here
|
(?! \. \s | \n{2} ) # disallow the first seperator here
|
||||||
\n (?! [ \t]* @\pL ) # disallow second seperator
|
[\n.] (?! [ \t]* @\pL ) # disallow second seperator
|
||||||
[^\n]+
|
[^\n.]+
|
||||||
)*
|
)*
|
||||||
\.?
|
\.?
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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();
|
$md = new \dflydev\markdown\MarkdownExtraParser();
|
||||||
$result = $md->transformMarkdown($result);
|
$result = $md->transformMarkdown($result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class Tag implements \Reflector
|
|||||||
$tag_name = str_replace(
|
$tag_name = str_replace(
|
||||||
' ', '', ucwords(str_replace('-', ' ', $matches[1]))
|
' ', '', ucwords(str_replace('-', ' ', $matches[1]))
|
||||||
).'Tag';
|
).'Tag';
|
||||||
$class_name = '\\phpDocumentor\\Reflection\\DocBlock\\Tag\\' . $tag_name;
|
$class_name = 'phpDocumentor\\Reflection\\DocBlock\\Tag\\' . $tag_name;
|
||||||
|
|
||||||
return (@class_exists($class_name))
|
return (@class_exists($class_name))
|
||||||
? new $class_name($matches[1], isset($matches[2]) ? $matches[2] : '')
|
? new $class_name($matches[1], isset($matches[2]) ? $matches[2] : '')
|
||||||
|
|||||||
@@ -44,4 +44,22 @@ DOCBLOCK;
|
|||||||
$this->assertTrue($object->hasTag('see'));
|
$this->assertTrue($object->hasTag('see'));
|
||||||
$this->assertTrue($object->hasTag('return'));
|
$this->assertTrue($object->hasTag('return'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testDotSeperation()
|
||||||
|
{
|
||||||
|
$fixture = <<<DOCBLOCK
|
||||||
|
/**
|
||||||
|
* This is a short description. This is a long description.
|
||||||
|
* This is a continuation of the long description.
|
||||||
|
*/
|
||||||
|
DOCBLOCK;
|
||||||
|
$object = new DocBlock($fixture);
|
||||||
|
$this->assertEquals(
|
||||||
|
'This is a short description.', $object->getShortDescription()
|
||||||
|
);
|
||||||
|
$this->assertEquals(
|
||||||
|
"This is a long description.\nThis is a continuation of the long description.", $object->getLongDescription()->getContents()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user