Fix an unexpected behaviour with @deprecated tags

This commit is contained in:
Guilhem N
2016-07-18 15:04:51 +02:00
committed by Ener-Getick
parent 9270140b94
commit 1be8bc1738
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -63,7 +63,10 @@ final class Deprecated extends BaseTag implements Factory\StaticMethod
$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(
+1 -1
View File
@@ -161,6 +161,6 @@ class DeprecatedTest extends \PHPUnit_Framework_TestCase
*/
public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex()
{
$this->assertNull(Deprecated::create('dkhf<'));
$this->assertEquals(new Deprecated(), Deprecated::create('dkhf<'));
}
}