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

@@ -35,34 +35,54 @@ class Token
private $value;
private $position;
public function __construct(?string $type, ?string $value, ?int $position)
/**
* @param int $type
* @param string $value
* @param int $position
*/
public function __construct($type, $value, $position)
{
$this->type = $type;
$this->value = $value;
$this->position = $position;
}
public function getType(): ?int
/**
* @return int
*/
public function getType()
{
return $this->type;
}
public function getValue(): ?string
/**
* @return string
*/
public function getValue()
{
return $this->value;
}
public function getPosition(): ?int
/**
* @return int
*/
public function getPosition()
{
return $this->position;
}
public function isFileEnd(): bool
/**
* @return bool
*/
public function isFileEnd()
{
return self::TYPE_FILE_END === $this->type;
}
public function isDelimiter(array $values = array()): bool
/**
* @return bool
*/
public function isDelimiter(array $values = array())
{
if (self::TYPE_DELIMITER !== $this->type) {
return false;
@@ -75,32 +95,50 @@ class Token
return in_array($this->value, $values);
}
public function isWhitespace(): bool
/**
* @return bool
*/
public function isWhitespace()
{
return self::TYPE_WHITESPACE === $this->type;
}
public function isIdentifier(): bool
/**
* @return bool
*/
public function isIdentifier()
{
return self::TYPE_IDENTIFIER === $this->type;
}
public function isHash(): bool
/**
* @return bool
*/
public function isHash()
{
return self::TYPE_HASH === $this->type;
}
public function isNumber(): bool
/**
* @return bool
*/
public function isNumber()
{
return self::TYPE_NUMBER === $this->type;
}
public function isString(): bool
/**
* @return bool
*/
public function isString()
{
return self::TYPE_STRING === $this->type;
}
public function __toString(): string
/**
* @return string
*/
public function __toString()
{
if ($this->value) {
return sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position);