Skip to content

Commit

Permalink
Use Token::$type directly if available
Browse files Browse the repository at this point in the history
  • Loading branch information
jsor committed Feb 5, 2023
1 parent 5be2d73 commit d9a2bdd
Show file tree
Hide file tree
Showing 49 changed files with 240 additions and 60 deletions.
5 changes: 4 additions & 1 deletion src/Functions/ST_AddPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_Area.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_AsBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_AsEWKB.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
25 changes: 20 additions & 5 deletions src/Functions/ST_AsGML.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,42 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
15 changes: 12 additions & 3 deletions src/Functions/ST_AsGeoJSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,26 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_AsHEXEWKB.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_AsLatLonText.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
10 changes: 8 additions & 2 deletions src/Functions/ST_AsSVG.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_Box2dFromGeoHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_Buffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_Collect.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_DWithin.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_Distance.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_DistanceSpheroid.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_GeoHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_GeomCollFromText.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_GeomFromGML.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_GeomFromGeoHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_GeomFromText.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_GeomFromWKB.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_GeometryFromText.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_HausdorffDistance.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_IsValid.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_IsValidDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_IsValidReason.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_Length.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
5 changes: 4 additions & 1 deletion src/Functions/ST_LineFromText.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public function parse(Parser $parser): void

$lexer = $parser->getLexer();

if (($lexer->lookahead['type'] ?? null) === Lexer::T_COMMA) {
/** @psalm-suppress DeprecatedMethod */
$nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;

if (Lexer::T_COMMA === $nextType) {
$parser->match(Lexer::T_COMMA);
$this->expressions[] = $parser->ArithmeticFactor();
}
Expand Down
Loading

0 comments on commit d9a2bdd

Please sign in to comment.