Skip to content

Commit

Permalink
Ref #168 - Add type checks in case a null value occurs
Browse files Browse the repository at this point in the history
Pull-request: #344

Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Aug 16, 2021
1 parent a724b5d commit 6ad0bb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Components/AlterOperation.php
Expand Up @@ -293,13 +293,13 @@ public static function parse(Parser $parser, TokensList $list, array $options =
$list->getNext();
$nextToken = $list->getNext();

if ($token->value === 'CHARACTER SET'){
if ($token->value === 'CHARACTER SET') {
// Reverting the changes we made in the beginning
$list->idx = $currentTokenID;
} else if ($token->value === 'SET' && $nextToken->value === '('){
} else if ($token->value === 'SET' && $nextToken !== null && $nextToken->value === '(') {
// To avoid adding the tokens between the SET() parentheses to the unknown tokens
$list->getNextOfTypeAndValue(Token::TYPE_OPERATOR, ')');
} else if ($token->value === 'SET' && $nextToken->value === 'DEFAULT'){
} else if ($token->value === 'SET' && $nextToken !== null && $nextToken->value === 'DEFAULT') {
// to avoid adding the `DEFAULT` token to the unknown tokens.
++$list->idx;
} else {
Expand Down

0 comments on commit 6ad0bb6

Please sign in to comment.