updated dependencies + working api connection

This commit is contained in:
Chris
2018-02-08 14:21:29 +00:00
parent dfc3c2194c
commit 30aea8e361
216 changed files with 21763 additions and 915 deletions

View File

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