aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/scssphp/source-span/src/Highlighter/Line.php
blob: 0dc800c3872961b9a879c33f9385e45e6b5d154a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

namespace SourceSpan\Highlighter;

/**
 * A single line of the source file being highlighted.
 *
 * @internal
 */
final class Line
{
    /**
     * All highlights that cover any portion of this line, in source span order.
     *
     * This is populated after the initial line is created.
     *
     * @var list<Highlight>
     */
    public array $highlights = [];

    /**
     * The URL of the source file in which this line appears.
     *
     * For lines created from spans without an explicit URL, this is an opaque
     * object that differs between lines that come from different spans.
     */
    public readonly object $url;


    /**
     * @param int $number The O-based line number in the source file
     */
    public function __construct(
        public readonly string $text,
        public readonly int $number,
        object $url,
    ) {
        $this->url = $url;
    }
}