10

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

Ahmad Zain
  • 179
  • 1
  • 2
  • 8

2 Answers2

40

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.

cantera
  • 24,479
  • 25
  • 95
  • 138
8

Just as cantera says, check the curly braces.

Here are some of symfony annotation errors:

The comma

  • Sample Code: @ORM\Column(name="column_name" type="string" length=20 nullable=false)
  • Error Message: [Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_PARENTHESIS, got 'type' at position 62 in property ...

Using the wrong type

  • Sample Code: @ORM\Column(name="column_name", type="string", length="20", nullable=false)
  • Error Message: [Type Error] Attribute "length" of @ORM\Column declared on property ...
Sand
  • 113
  • 2
  • 6