Have a look at the following trait: As you can see the trait makes sure that the using class holds a certain model instance and it implements certain methods. This works as long as the implementing class does not override the constructor. So here is my question: I want to make sure that either the constructor is called or a
Tag: traits
Php, is it OK to use traits for DI?
consider this example: class MyClass { public function doSomething() { $this->injected->getIt(); } } so far so simple (apart from injected is not injected). So, in full …