Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -56,7 +56,7 @@ class TokenStream
*
* @return $this
*/
public function push(Token $token)
public function push(Token $token): self
{
$this->tokens[] = $token;
@@ -68,7 +68,7 @@ class TokenStream
*
* @return $this
*/
public function freeze()
public function freeze(): self
{
return $this;
}
@@ -76,11 +76,9 @@ class TokenStream
/**
* Returns next token.
*
* @return Token
*
* @throws InternalErrorException If there is no more token
*/
public function getNext()
public function getNext(): Token
{
if ($this->peeking) {
$this->peeking = false;
@@ -98,10 +96,8 @@ class TokenStream
/**
* Returns peeked token.
*
* @return Token
*/
public function getPeek()
public function getPeek(): Token
{
if (!$this->peeking) {
$this->peeked = $this->getNext();
@@ -116,19 +112,17 @@ class TokenStream
*
* @return Token[]
*/
public function getUsed()
public function getUsed(): array
{
return $this->used;
}
/**
* Returns nex identifier token.
*
* @return string The identifier token value
* Returns next identifier token.
*
* @throws SyntaxErrorException If next token is not an identifier
*/
public function getNextIdentifier()
public function getNextIdentifier(): string
{
$next = $this->getNext();
@@ -140,13 +134,11 @@ class TokenStream
}
/**
* Returns nex identifier or star delimiter token.
*
* @return string|null The identifier token value or null if star found
* Returns next identifier or null if star delimiter token is found.
*
* @throws SyntaxErrorException If next token is not an identifier or a star delimiter
*/
public function getNextIdentifierOrStar()
public function getNextIdentifierOrStar(): ?string
{
$next = $this->getNext();
@@ -155,7 +147,7 @@ class TokenStream
}
if ($next->isDelimiter(['*'])) {
return;
return null;
}
throw SyntaxErrorException::unexpectedToken('identifier or "*"', $next);