In a PHP trait, can I use self as the return type of a method? Will it reference the class that imports the trait?
<?php
declare(strict_types=1);
trait MyTrait
{
public function setSomething(array $data): self
// ^ is this ok?
{
$this->update($data);
return $this;
}
}