Merge pull request #79 from Ener-Getick/patch-1

Fix an unexpected behaviour with @deprecated tags
This commit is contained in:
Mike van Riel
2016-09-30 09:12:33 +02:00
committed by GitHub
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 = []; $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(
+1 -1
View File
@@ -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<'));
} }
} }