I want to use some functions of PHP 7, but I’m kind of struggling with it.
I have a Symfony-Project using Doctrine to display some Entities. New in PHP 7 are the GROUP USE-Statemens that I wanted to try. But it seems like I'm doing something wrong, since Symfony / Doctrine cannot resolve annotations in an Entity-Object.
Use expression:
use Doctrine\ORM\Mapping\{Entity, Id, Table, Column, GeneratedValue, JoinColumn, OneToOne, ManyToMany, JoinTable};
Entity
class Expansion {
..
}
Exception
[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?
If I use single USE-Statement, the import works fine ...
What am I doing wrong? The versions are correct. PHPStorm also says that "Alias XY" is never used.
Thanks for your support!
source
share