I encountered a class which has the following method:
class Period
{
/** @var \DateTime */
public $startDate;
/** @var \DateTime */
public $endDate;
public static function create(DateTime $startDate, $endDate): Period
{
return new static($startDate, $endDate);
}
}
My question is about the part after the create(...) - the ": Period". I have never seen this before and can't find any documentation about it (mainly because I have no clue what to look for). Can anyone shed some light on this?