Skip to content

Loading…

DDC-183: Annotation parser barfs on "@something at." #2488

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user amirabiri:

Here's an odd one: The annotations parser has some quirk where it barfs if the comment contains a line that starts with any tag and ends with "at.":

/****
 * @Entity
 * @test at.
 */
class A
{
}

$a = new A;
$em->persist($a);

The result is:

PHP Fatal error:  Uncaught exception 'Doctrine\Common\Annotations\AnnotationException'
    with message '[Syntax Error] Expected Doctrine\Common\Annotations\Lexer::T_IDENTIFIER, got '.' at position 19 in class A.'
    in Doctrine\Common\Annotations\AnnotationException.php:39
Stack trace:
#0  Doctrine\Common\Annotations\Parser.php(182): Doctrine\Common\Annotations\AnnotationException::syntaxError('Expected Doctri...')
#1  Doctrine\Common\Annotations\Parser.php(150): Doctrine\Common\Annotations\Parser->syntaxError('Doctrine\Common...')
#2  Doctrine\Common\Annotations\Parser.php(229): Doctrine\Common\Annotations\Parser->match(2)
#3  Doctrine\Common\Annotations\Parser.php(204): Doctrine\Common\Annotations\Parser->Annotation()
#4  Doctrine\Common\Annotations\Parser.php(134): Doctrine\Common\Annotations\Parser->Annotations()
#5  Doctrine\Common\Annotations\AnnotationReader.php(102): Doctrine\Common\Annotations\Parser->parse('/***? ** @Entity?...', 'class A')
#6  Doctrine\ORM\Mapping\Driver\AnnotationDriver.php(73): Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object(ReflectionClass))
#7  Doctrine\ORM\Mapping\ClassMetadataFactory.php(196): Doctrine\ORM\Mapping\Driver\AnnotationDriver->loadMetadataForClass('A', Object(Doctrine\ORM\Mapping\ClassMetadata))
#8  Doctrine\ORM\Mapping\ClassMetadataFactory.php(111): Doctrine\ORM\Mapping\ClassMetadataFactory->_loadMetadata('A')
#9  Doctrine\ORM\EntityManager.php(214): Doctrine\ORM\Mapping\ClassMetadataFactory->getMetadataFor('A')
#10 Doctrine\ORM\UnitOfWork.php(1182): Doctrine\ORM\EntityManager->getClassMetadata('A')
#11 Doctrine\ORM\UnitOfWork.php(1160): Doctrine\ORM\UnitOfWork->_doPersist(Object(A), Array)
#12 Doctrine\ORM\EntityManager.php(393): Doctrine\ORM\UnitOfWork->persist(Object(A))
#13 test.php(40): Doctrine\ORM\EntityManager->persist(Object(A))
#14 {main}
@doctrinebot

Comment created by ivo.nascimento:

i, I'm attempting to fix this one myself. Patch will be uploaded when ready.

@doctrinebot

Comment created by @guilhermeblanco:

In r6974 this issue was fixed.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-ALPHA4 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.