Skip to content

Commit 595830f

Browse files
committed
Add better type hints
1 parent b29299f commit 595830f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ExtractOffset.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
class ExtractOffset
1010
{
1111
/**
12-
* @return array<string>
12+
* @return array{string,int,int}
1313
*/
1414
public static function fromSource(string $source, string $marker = '<>'): array
1515
{
1616
list($source, $offsetStart) = self::extractOffset($source, $marker);
1717
list($source, $offsetEnd) = self::extractOffset($source, $marker);
1818

19-
return [$source, $offsetStart, $offsetEnd];
19+
return [$source, (int)$offsetStart, (int)$offsetEnd];
2020
}
2121

2222
/**
2323
* Extract the byte offset from the given marked source
2424
* and remove the <> mark.
2525
*
26-
* @return array<mixed>
26+
* @return array{string,int}
2727
*/
2828
private static function extractOffset(string $source, string $marker): array
2929
{

0 commit comments

Comments
 (0)