mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 18:13:13 +00:00
Merge pull request #79 from Ener-Getick/patch-1
Fix an unexpected behaviour with @deprecated tags
This commit is contained in:
@@ -63,7 +63,10 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod
|
|||||||
|
|
||||||
$matches = [];
|
$matches = [];
|
||||||
if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) {
|
if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) {
|
||||||
return null;
|
return new static(
|
||||||
|
null,
|
||||||
|
null !== $descriptionFactory ? $descriptionFactory->create($body, $context) : null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new static(
|
return new static(
|
||||||
|
|||||||
@@ -161,6 +161,6 @@ class DeprecatedTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex()
|
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex()
|
||||||
{
|
{
|
||||||
$this->assertNull(Deprecated::create('dkhf<'));
|
$this->assertEquals(new Deprecated(), Deprecated::create('dkhf<'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user