A Trait adds the code it contains to the class in which it is use
d, so you wouldn’t call it with the name of the trait, you just call it as an method on the class that use
s it.
i.e.:
// SomeTrait.php
trait SomeTrait {
function methodName($arg) {
// do something
}
}
// SomeClass.php
class SomeClass {
use SomeTrait;
function doTheThing() {
return array_map([$this, 'methodName'], $array);
}
}