3 ms·
Classes are/were thought as awesome because you can do dependency injection via providing an object, but you can't easily do that with just providing a differen
by pas 7y ago
Classes are/were thought as awesome because you can do dependency injection via providing an object, but you can't easily do that with just providing a different implementation namespace.
That said, maybe PHP is not the language where you need to do DI. Just have a few different config files around, do the includes and wiring there and that's it. And hope for the best. (After all there's no compile, no checking of interface correctness with any kind of DI either.)