Add support for anonymous migrations

This commit is contained in:
Ernestas Kvedaras 2022-03-01 16:30:41 +01:00
parent b156f55956
commit 3d9c5a7443

View File

@ -23,6 +23,12 @@ class SchemaAggregator
foreach ($stmts as $stmt) {
if ($stmt instanceof PhpParser\Node\Stmt\Class_) {
$this->addClassStatements($stmt->stmts);
} elseif (
$stmt instanceof PhpParser\Node\Stmt\Return_ &&
$stmt->expr instanceof PhpParser\Node\Expr\New_ &&
$stmt->expr->class instanceof PhpParser\Node\Stmt\Class_
) {
$this->addClassStatements($stmt->expr->class->stmts);
}
}
}