类的方法返回$this,应该如何写注释?
环境:PHP 8.0
class User
{
private $name;
/**
* @rertun static
*/
public function setName(): static //请问这里应该是static?self?User?
{
$this->name = 'tom';
return $this;
}
}
推荐文章: