Symfony2 学说:生成:实体抛出语法错误? [英] Symfony2 doctrine:generate:entities throw Syntax Error?
本文介绍了Symfony2 学说:生成:实体抛出语法错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用 symfony2 shell 并尝试运行时
doctrine:generate:entities [MyBundle] --path='src'
或
doctrine:generate:entities [MyBundle]
我收到了这个错误
[Syntax Error] Expected DoctrineCommonAnnotationsDocLexer::T_CLOSE_CURLY_BRACES, got '@' at position 255 in property
请问有什么解决办法吗??
提前致谢
推荐答案
我也遇到过这个错误.这只是您的一个实体注释中的一个简单错字.快速检查您的实体将显示如下内容:
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:
/**
* @ORMId
* @ORMColumn(type="integer" // note the missing close parentheses
* @ORMGeneratedValue(strategy="AUTO")
*/
protected $id;
考虑到行号,它可能位于您的一个实体关联映射中.
Taking into account the line number, it's probably somewhere in one of your entity association mappings.
这篇关于Symfony2 学说:生成:实体抛出语法错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文