The following code:
trait T {
function foo() {}
}
class C {
use T { T::foo as bar; }
use T { T::foo as baz; }
}
Produces the following error:
Trait method bar has not been applied, because there are collisions with other trait methods on C
Is it possible to use a trait twice in a class?
To "import" a method defined in a trait multiple times with different names do this:
Yes, you can use a trait twice: