Merge pull request #224 from ekvedaras/master

Add support for anonymous migrations
This commit is contained in:
feek 2022-03-04 12:28:25 -05:00 committed by GitHub
commit 902d217a1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,12 @@ class SchemaAggregator
foreach ($stmts as $stmt) { foreach ($stmts as $stmt) {
if ($stmt instanceof PhpParser\Node\Stmt\Class_) { if ($stmt instanceof PhpParser\Node\Stmt\Class_) {
$this->addClassStatements($stmt->stmts); $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);
} }
} }
} }