Skip to content

Commit

Permalink
DCOM-6 - Change fix to skip unknown aliases instead of throwing an ex…
Browse files Browse the repository at this point in the history
…ception
  • Loading branch information
beberlei committed Sep 1, 2010
1 parent ad49a67 commit 8e2dc32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/Doctrine/Common/Annotations/Parser.php
Expand Up @@ -318,7 +318,8 @@ public function Annotation()

// If the namespace alias doesnt exist, throw exception
if ( ! isset($this->namespaceAliases[$alias])) {
$this->syntaxError('a valid namespace alias', $this->lexer->token);
$this->lexer->skipUntil(Lexer::T_AT);
return false;
}

$name = $this->namespaceAliases[$alias] . implode('\\', $nameParts);
Expand Down
6 changes: 3 additions & 3 deletions tests/Doctrine/Tests/Common/Annotations/ParserTest.php
Expand Up @@ -301,13 +301,13 @@ class A {

/**
* @group DCOM-6
*
* @expectedException Doctrine\Common\Annotations\AnnotationException
*/
public function testNonexistantNamespaceAlias()
{
$parser = new Parser;
$parser->parse('@nonalias:Name(foo="bar")');
$result = $parser->parse('@nonalias:Name(foo="bar")');

$this->assertEquals(0, count($result));
}
}

Expand Down

0 comments on commit 8e2dc32

Please sign in to comment.