-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathLocation.php
More file actions
41 lines (35 loc) · 888 Bytes
/
Location.php
File metadata and controls
41 lines (35 loc) · 888 Bytes
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
41
<?php
namespace Phpactor\TextDocument;
class Location
{
public function __construct(
private TextDocumentUri $uri,
private ByteOffsetRange $range
) {
}
public static function fromPathAndOffsets(string $path, int $start, int $end): self
{
return new self(
TextDocumentUri::fromString($path),
ByteOffsetRange::fromInts($start, $end),
);
}
/**
* @deprecated Use fromPathAndOffsets instead
*/
public static function fromPathAndOffset(string $path, int $offset): self
{
return new self(
TextDocumentUri::fromString($path),
ByteOffsetRange::fromInts($offset, $offset),
);
}
public function uri(): TextDocumentUri
{
return $this->uri;
}
public function range(): ByteOffsetRange
{
return $this->range;
}
}