file naming conventions for traits / interfaces
Posted: Mon Sep 14, 2015 10:08 am
I'm trying out using traits & interfaces for the first time, and trying to figure out best practices for including them. We do not use a framework.
We keep our PHP classes in their own directory with filenames like "class.[classname].php". We then define an autoloader that loads files in classDirectory/class.{classname}.php in each PHP file that requires a class.
What should I name the file containing my trait or interface? It feels like "class.[classname].php" isn't appropriate, because they aren't classes, but if I name it differently, I have to modify all of my autoloads. Thoughts?
We keep our PHP classes in their own directory with filenames like "class.[classname].php". We then define an autoloader that loads files in classDirectory/class.{classname}.php in each PHP file that requires a class.
What should I name the file containing my trait or interface? It feels like "class.[classname].php" isn't appropriate, because they aren't classes, but if I name it differently, I have to modify all of my autoloads. Thoughts?