Kind of like Mixins?
PHP only supports single inheritance: a child class can inherit only from one single parent. So, what if a class needs to inherit multiple behaviors? OOP traits solve this problem.
Traits are used to declare methods that can be used in multiple classes. Traits can have methods and abstract methods that can be used in multiple classes, and the methods can have any access modifier (public, private, or protected).
PHP only supports single inheritance: a child class can inherit only from one single parent.
I couldn't understand why my local dev classes were not being auto loaded. I found the reason why here. I added the following to my composer.json. The "name" is what all your autoloaded classes are started with and the "src/" is where all your project code is.
This is a password protected section available to those who know me in some fashion. If you know me and you do not already have a login, you can request a login here.
I am nuts about books. I read on all kinds of topics. I attempt to review each book I read for the sake of my own enrichment as well as conversation starters with others.
You never know what you will find in an attic! Usually there is a hodgepodge of things buried under dust.