Commaaa2
This commit is contained in:
13
vendor/symfony/css-selector/Parser/Reader.php
vendored
13
vendor/symfony/css-selector/Parser/Reader.php
vendored
@@ -23,13 +23,12 @@ namespace Symfony\Component\CssSelector\Parser;
|
||||
*/
|
||||
class Reader
|
||||
{
|
||||
private string $source;
|
||||
private int $length;
|
||||
private int $position = 0;
|
||||
|
||||
public function __construct(string $source)
|
||||
{
|
||||
$this->source = $source;
|
||||
public function __construct(
|
||||
private string $source,
|
||||
) {
|
||||
$this->length = \strlen($source);
|
||||
}
|
||||
|
||||
@@ -53,7 +52,7 @@ class Reader
|
||||
return substr($this->source, $this->position + $offset, $length);
|
||||
}
|
||||
|
||||
public function getOffset(string $string)
|
||||
public function getOffset(string $string): int|false
|
||||
{
|
||||
$position = strpos($this->source, $string, $this->position);
|
||||
|
||||
@@ -71,12 +70,12 @@ class Reader
|
||||
return false;
|
||||
}
|
||||
|
||||
public function moveForward(int $length)
|
||||
public function moveForward(int $length): void
|
||||
{
|
||||
$this->position += $length;
|
||||
}
|
||||
|
||||
public function moveToEnd()
|
||||
public function moveToEnd(): void
|
||||
{
|
||||
$this->position = $this->length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user