Given the example below, how can you use the Trait
method inside the static
method of the class?
Is it bad practice? What is the right way?
trait TestTraits
{
public function thistraitmethod($data)
{
return $data;
}
}
class ClassUsingTrait
{
use TestTraits;
public static function staticmethod($data)
{
return $this->thistraitmethod($data);
}
}