Skip to content

Commit

Permalink
Merge pull request #224 from ekvedaras/master
Browse files Browse the repository at this point in the history
Add support for anonymous migrations
  • Loading branch information
mr-feek authored Mar 4, 2022
2 parents b156f55 + 3d9c5a7 commit 902d217
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Handlers/Eloquent/Schema/SchemaAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public function addStatements(array $stmts): void
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);
}
}
}
Expand Down

0 comments on commit 902d217

Please sign in to comment.