How do you call the parent constructor in a subclass of a trait? For example, PHP: trait Bar{ public function __construct($name){ // blah blah blah }}class Foo{ use Bar; public function __construct(Player $player){ // how do you give $player->getName() to Bar parent? }}
I didn't think traits used a construct method. But you can call functions in inherited traits using $this->function_name(). I am not sure if this answers your question.
I did some StackOverflow searching and found this: PHP: class MyHelloWorld extends Base { use SayWorld { SayWorld::__construct as private __swConstruct; } public function __construct($a, $b, $c = 0) { $this->__swConstruct($a, $b, $c); }}