Skip to content

Commit

Permalink
Fix invalid loop break in DataTableFactory
Browse files Browse the repository at this point in the history
The loop should break after the first proxy query factory matches. With break outside of the if statement, if the first proxy query factory does not support the given data, it would break the loop, creating more issues.
  • Loading branch information
Kreyu authored Oct 3, 2024
1 parent 6324bdd commit 302e718
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/DataTableFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ public function createNamedBuilder(string $name, string $type = DataTableType::c
foreach ($this->registry->getProxyQueryFactories() as $proxyQueryFactory) {
if ($proxyQueryFactory->supports($data)) {
$query = $proxyQueryFactory->create($data);
break;
}

break;
}
}

Expand Down

0 comments on commit 302e718

Please sign in to comment.