<?php

/**
 * Comment attached to a Vala-IR node.
 */
final class ValaIrComment
{
    private string $kind;
    private string $text;
    private int $startLine;
    private int $endLine;

    /**
     * Create one Vala-IR comment.
     */
    public function __construct(string $kind, string $text, int $startLine, int $endLine)
    {
        $this->kind = $kind;
        $this->text = $text;
        $this->startLine = $startLine;
        $this->endLine = $endLine;
    }

    /**
     * Convert to a plain array for debugging/export.
     */
    public function toArray(): array
    {
        return [
            'kind' => 'Comment',
            'commentKind' => $this->kind,
            'text' => $this->text,
            'startLine' => $this->startLine,
            'endLine' => $this->endLine,
        ];
    }
}
