PHP 7和Doctrine Group使用

Rem*_*emo 4 symfony doctrine-orm php-7

我想使用PHP 7的一些功能,但我有点挣扎.

我有一个Symfony-Project使用Doctrine来映射一些实体.PHP 7中的新功能是GROUP USE-Statemens,我想尝试一下.但似乎我做错了,因为Symfony/Doctrine无法解析实体对象中的注释.

使用-声明:

use Doctrine\ORM\Mapping\{Entity, Id, Table, Column, GeneratedValue, JoinColumn, OneToOne, ManyToMany, JoinTable};
Run Code Online (Sandbox Code Playgroud)

实体

/**
 * @Entity
 * @Table(name="expansion")
 */
class Expansion {
..
}
Run Code Online (Sandbox Code Playgroud)

例外

[Semantical Error] The annotation "@Entity" in class AppBundle\Entity\Expansion was never imported. Did you maybe forget to add a "use" statement for this annotation?
Run Code Online (Sandbox Code Playgroud)

如果我使用单个USE语句,导入工作完美...

我究竟做错了什么?版本是正确的.此外,PHPStorm表示从未使用过'Alias XY'.

感谢您的支持!

Ste*_*rig 5

我不是百分百肯定,但我敢打赌,该Doctrine\Common\Annotations组件还不能处理PHP7分组use语句.我找不到任何确认此假设的书面陈述,但Doctrine\Common\Annotations\TokenParser::parseUseStatement似乎根本不处理分组名称空间.