Top "Traits" questions

In computer programming, a trait is a collection of methods, used as a "simple conceptual model for structuring object oriented programs"

How to unit test PHP traits

I want to know if there is a solution on how to unit-test a PHP trait. I know we can …

php unit-testing phpunit traits
References to traits in structs

I have a trait Foo pub trait Foo { fn do_something(&self) -> f64; } and a struct which …

rust traits
Scala, Extend object with a generic trait

I'm using Scala and I want to extend a (singleton) object with a trait, which delivers a data structure and …

scala singleton extend type-mismatch traits
How to check if a class uses a trait in PHP?

Notice that a trait may use other traits, so the class may not be using that trait directly. And also …

php traits
Overriding Doctrine Trait Properties

I know you can override a trait method by declaring it in your class, I was curious if was possible …

php traits
Initializing an anonymous class with a trait

Can someone help me understand the following behavior? Simply put: what is the difference between the following two cases where... …

class scala inheritance initialization traits
java traits or mixins pattern?

Is there a way to emulate mixins or traits in java? basically, I need a way to do multiple inheritance …

java mixins traits
How do you return an Iterator in Scala?

What must I do in order to be able to return an Iterator from a method/class ? How would one …

scala iterator traits
How to call super method when overriding a method through a trait

It would appear that it is possible to change the implementation of a method on a class with a trait …

scala polymorphism mixins traits