I've never used traits in that manner before, so I can't be sure if PHP lets these mistakes through, but I am expecting a parse error or syntax error due to there being logic directly inside the class definition. A class definition cannot have any if() statements, loops of any kind or function calls outside of the methods.
The thing with traits and all other object-oriented features is that they have to be clearly established before the code starts running. Before you begin writing your code you clearly define each of the classes and their relationships with other classes, interfaces and traits. You don't choose at runtime which trait your class is going to use, your class was either defined with a specific trait, or defined without the trait. Traits are also not necessary if only one single class is using them, just put the trait's features right into the class definition itself.