I guess I can't create a Trait
or Interface
directory inside my bundle since this is a keyword that would bring problems when used (i.e. use MyBundle\trait\MyTrait
).
Is there a best practice about how to name these directories ?
Regarding naming convention, see coding standards
Regarding directory structure, I don't specifically put them in a trait directory. It depends on how you want to organize your code. Generally, most people will put the trait inside a package folder for the behaviour it represents, i.e., Mysql\ConnectionTrait
Symfony specific: Put your traits in Util folder. In terms of the interfaces; e.g. you have a service class called Hello and HelloInterface then they both should go to Service folder or if you have some kind of class called Yow and YowInterface then you can put them Util folder as well. As simple as that.