text = $text; return $this; } /** * Get the text of the line * * @return string */ public function getText(): string { return $this->text; } /** * Set the line number * * @param int $number * @return $this */ public function setNumber(int $number): static { $this->number = $number; return $this; } /** * Get the line number * * @return int */ public function getNumber(): int { return $this->number; } /** * @return string */ public function __toString(): string { return $this->getText(); } /** * @return array */ public function jsonSerialize(): array { return [ 'number' => $this->getNumber(), 'content' => $this->getText() ]; } }