Skip to content

Commit

Permalink
Remove @var annotation in Table::getColumnGenerationExpression
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Nov 15, 2021
1 parent f84b1fc commit 7fc8c4b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libraries/classes/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -2628,11 +2628,12 @@ public function getColumnGenerationExpression($column = null)
}

$parser = new Parser($createTable);
/**
* @var CreateStatement $stmt
*/
$stmt = $parser->statements[0];
$fields = TableUtils::getFields($stmt);
$fields = [];
if ($stmt instanceof CreateStatement) {
$fields = TableUtils::getFields($stmt);
}

if ($column != null) {
$expression = isset($fields[$column]['expr']) ?
substr($fields[$column]['expr'], 1, -1) : '';
Expand Down

0 comments on commit 7fc8c4b

Please sign in to comment.