Skip to content

Commit 1d3dd12

Browse files
authored
Merge pull request #89 from Seldaek/fix_regex
Fix regex for tag name extraction and restore disabled test
2 parents 8331b5e + 248e5f6 commit 1d3dd12

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/DocBlock/StandardTagFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function registerTagHandler($tagName, $handler)
161161
private function extractTagParts($tagLine)
162162
{
163163
$matches = array();
164-
if (! preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us', $tagLine, $matches)) {
164+
if (! preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\s+([^\s].*)|$)/us', $tagLine, $matches)) {
165165
throw new \InvalidArgumentException(
166166
'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors'
167167
);

tests/unit/DocBlock/StandardTagFactoryTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,10 @@ public function testPassingYourOwnSetOfTagHandlers()
136136
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct
137137
* @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService
138138
* @expectedException \InvalidArgumentException
139-
* @expectedExceptionMessage The tag "@user/myuser" does not seem to be wellformed, please check it for errors
139+
* @expectedExceptionMessage The tag "@user[myuser" does not seem to be wellformed, please check it for errors
140140
*/
141141
public function testExceptionIsThrownIfProvidedTagIsNotWellformed()
142142
{
143-
$this->markTestIncomplete(
144-
'For some reason this test fails; once I have access to a RegEx analyzer I will have to test the regex'
145-
)
146-
;
147143
$tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class));
148144
$tagFactory->create('@user[myuser');
149145
}

0 commit comments

Comments
 (0)