Skip to content

Commit 89e7821

Browse files
CodeWithDennisgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 7f9318c commit 89e7821

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/SelectTree.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private function buildTreeFromResults($results, $parent = null): Collection
216216
$resultKey = $this->getCustomKey($result);
217217
$resultCache[$resultKey]['in_set'] = 1;
218218
// Move any cached children to the result map
219-
if(isset($resultCache[$resultKey]['children'])){
219+
if (isset($resultCache[$resultKey]['children'])) {
220220
// Since the result map won't have a key for a given result until it's confirmed to be in the set (i.e. this very moment),
221221
// we don't have to preserve the previous value for that key; it is guaranteed to have been unset
222222
$resultMap[$resultKey] = $resultCache[$resultKey]['children'];
@@ -228,7 +228,7 @@ private function buildTreeFromResults($results, $parent = null): Collection
228228
$resultCache[$parentKey]['in_set'] = 0;
229229
$resultCache[$parentKey]['children'] = [];
230230
}
231-
if($resultCache[$parentKey]['in_set']){
231+
if ($resultCache[$parentKey]['in_set']) {
232232
// if the parent has been confirmed to be in the set, add directly to result map
233233
$resultMap[$parentKey][] = $result;
234234
} else {
@@ -239,16 +239,16 @@ private function buildTreeFromResults($results, $parent = null): Collection
239239

240240
// Filter the cache for missing parents in the result set and get the children
241241
$orphanedResults = array_map(
242-
fn($item) => $item['children'],
242+
fn ($item) => $item['children'],
243243
array_filter(
244244
$resultCache,
245-
fn($item) => !$item['in_set']
245+
fn ($item) => ! $item['in_set']
246246
)
247247
);
248248

249249
// Move any remaining children from the cache into the root of the tree, since their parents do not show up in the result set
250250
$resultMap[$parent] = [];
251-
foreach($orphanedResults as $orphanedResult){
251+
foreach ($orphanedResults as $orphanedResult) {
252252
$resultMap[$parent] += $orphanedResult;
253253
}
254254

0 commit comments

Comments
 (0)