No, not all of my classes are in the container. If they are there or not depends on if they need any sort of configuration settings or other dependencies they have. This is partly because I’m not using Pimple as my container (Slim’s default) and I use PHP-DI instead. Therefore, I can take advantage of Autowiring which uses reflection to find and create the dependencies for some of my classes.
So none of my controllers happen to need an entry in the container, nor do any of my models. Some of my middlewares need an entry because the configuration depends on the environment, etc. If a create()
method in my Controller needs the Request object, PHP-DI can figure out where that class is and how to construct it by itself. It is a bit of magic, which some people love and others greatly dislike. But I also think there is a lot of good that comes from learning DI “the hard way” to provide a better architecture and not just cheat with some magic sparkle dust. Part of why I’m using PHP-DI is because the amount of controllers, middleware, etc I was having to define in the container was getting quite long.
I have Coda 2 and use it frequently, but not for most of my PHP projects. I use Coda primarily for projects that are mostly HTML and CSS or when I need to make edits to live sites not under version control or deployment scripts. Lately I’ve been using Atom most of the time. Many people who are doing this much more, and with skills far beyond me swear by PHPStorm.