Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony : is there a best practice about the directories' name including traits and interfaces?

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 ?

like image 977
Edouard Hienrichs Avatar asked Jun 10 '15 14:06

Edouard Hienrichs


1 Answers

  • Symfony best practises
  • Symfony - Organizing Your Business Logic
  • PSR coding standards

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.

like image 122
BentCoder Avatar answered Sep 28 '22 00:09

BentCoder