start = $start; $tmp->end = $end; return $tmp; } public function __construct(?Token $startToken = null, ?Token $endToken = null, ?Source $source = null) { $this->startToken = $startToken; $this->endToken = $endToken; $this->source = $source; if ($startToken === null || $endToken === null) { return; } $this->start = $startToken->start; $this->end = $endToken->end; } /** @return LocationArray */ public function toArray(): array { return [ 'start' => $this->start, 'end' => $this->end, ]; } }