Skip to content

Commit 5436c3d

Browse files
wouterjnicolas-grekas
authored andcommitted
Add PHP types to private methods and functions
1 parent cda0fa7 commit 5436c3d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Parser/Reader.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ public function getSubstring(int $length, int $offset = 0): string
5353
return substr($this->source, $this->position + $offset, $length);
5454
}
5555

56-
public function getOffset(string $string)
56+
/**
57+
* @return int|false
58+
*/
59+
public function getOffset(string $string): int|bool
5760
{
5861
$position = strpos($this->source, $string, $this->position);
5962

@@ -71,12 +74,12 @@ public function findPattern(string $pattern): array|false
7174
return false;
7275
}
7376

74-
public function moveForward(int $length)
77+
public function moveForward(int $length): void
7578
{
7679
$this->position += $length;
7780
}
7881

79-
public function moveToEnd()
82+
public function moveToEnd(): void
8083
{
8184
$this->position = $this->length;
8285
}

0 commit comments

Comments
 (0)