Skip to content

Commit

Permalink
Merge pull request #77 from starter-dev/patch-3
Browse files Browse the repository at this point in the history
Fix: incorrect logic in PR #75 merge
  • Loading branch information
tcampbPPU authored Jul 8, 2024
2 parents 88c99b9 + 6a82ce6 commit 453af86
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Actions/BuildModelDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,16 @@ private function getModelDetails(SplFileInfo $modelFile, bool $resolveAbstract):

private function overrideCollectionWithInterfaces(Collection $columns, Collection $interfaces): Collection
{
return $columns->map(function ($column) use ($interfaces) {
$interfaces->each(function ($interface, $key) use (&$column, $interfaces) {
if ($key === $column['name']) {
$column['type'] = $interface['type'];
$column['forceType'] = true;
return $columns->filter(function ($column) use ($interfaces) {
$includeColumn = true;

$interfaces->forget($key);
$interfaces->each(function ($interface, $key) use ($column, &$includeColumn) {
if ($key === $column['name']) {
$includeColumn = false;
}
});

return $column;
return $includeColumn;
});
}
}

0 comments on commit 453af86

Please sign in to comment.