Symfony2 doctrine:generate:entities throw Syntax Error?

Ahmad Zain picture Ahmad Zain · Feb 14, 2012 · Viewed 32.4k times · Source

when i am using the symfony2 shell and trying to run

doctrine:generate:entities [MyBundle] --path='src' 

or

doctrine:generate:entities [MyBundle] 

i got this error

[Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_CURLY_BRACES, got '@' at position 255 in property

so please any solutions ??

thanks in advance

Answer

cantera picture cantera · Feb 15, 2012

I've encountered this error also. It's just a simple typo in one of your Entity annotations. A quick check of your entities will reveal something like this:

/**
 * @ORM\Id
 * @ORM\Column(type="integer"              // note the missing close parentheses
 * @ORM\GeneratedValue(strategy="AUTO")
 */
protected $id;

Taking into account the line number, it's probably somewhere in one of your entity association mappings.