Dependency updates and update version number

This commit is contained in:
Kode
2018-06-13 19:35:28 +01:00
parent 18ec208381
commit e3ec7de23a
1261 changed files with 45582 additions and 29687 deletions

View File

@@ -27,56 +27,33 @@ class Reader
private $length;
private $position = 0;
/**
* @param string $source
*/
public function __construct($source)
public function __construct(string $source)
{
$this->source = $source;
$this->length = strlen($source);
}
/**
* @return bool
*/
public function isEOF()
public function isEOF(): bool
{
return $this->position >= $this->length;
}
/**
* @return int
*/
public function getPosition()
public function getPosition(): int
{
return $this->position;
}
/**
* @return int
*/
public function getRemainingLength()
public function getRemainingLength(): int
{
return $this->length - $this->position;
}
/**
* @param int $length
* @param int $offset
*
* @return string
*/
public function getSubstring($length, $offset = 0)
public function getSubstring(int $length, int $offset = 0): string
{
return substr($this->source, $this->position + $offset, $length);
}
/**
* @param string $string
*
* @return int
*/
public function getOffset($string)
public function getOffset(string $string)
{
$position = strpos($this->source, $string, $this->position);
@@ -84,11 +61,9 @@ class Reader
}
/**
* @param string $pattern
*
* @return array|false
*/
public function findPattern($pattern)
public function findPattern(string $pattern)
{
$source = substr($this->source, $this->position);
@@ -99,10 +74,7 @@ class Reader
return false;
}
/**
* @param int $length
*/
public function moveForward($length)
public function moveForward(int $length)
{
$this->position += $length;
}