snippet = $snippet; } public static function fromParseException(ParseException $exception): self { return new self( LintError::TYPE_ERROR, $exception->getMessage(), $exception->getParsedFile(), $exception->getParsedLine(), $exception->getSnippet() ); } public function getSnippet(): string { return $this->snippet; } public function __toString(): string { return sprintf('[%s] %s', strtoupper($this->getType()), $this->getError()); } }