From 75a1e5ca4ad6957223cc8e024e4badc0f70a7af4 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 28 Aug 2025 00:12:00 +1200 Subject: [PATCH] Format --- src/Appwrite/Utopia/Request/Filters/V20.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Utopia/Request/Filters/V20.php b/src/Appwrite/Utopia/Request/Filters/V20.php index d6e95ec327..3c605b0248 100644 --- a/src/Appwrite/Utopia/Request/Filters/V20.php +++ b/src/Appwrite/Utopia/Request/Filters/V20.php @@ -38,7 +38,7 @@ class V20 extends Filter // Handle case where queries is an array but empty if (\is_array($content['queries'])) { - $content['queries'] = \array_filter($content['queries'], function($q) { + $content['queries'] = \array_filter($content['queries'], function ($q) { if (\is_object($q) && empty((array)$q)) { return false; } @@ -59,7 +59,7 @@ class V20 extends Filter } $selections = Query::groupByType($parsed)['selections'] ?? []; - + // Check if we need to add wildcard + relationships // This happens when: // 1. No select queries exist, OR @@ -123,7 +123,7 @@ class V20 extends Filter ) { return []; } - + // Check if we've already visited this collection in the current path to prevent cycles if (in_array($collectionId, $visited)) { return []; @@ -163,7 +163,7 @@ class V20 extends Filter $key = $attr['key']; $fullKey = $prefix ? $prefix . '.' . $key : $key; $relatedCollectionId = $attr['relatedCollection'] ?? null; - + // Skip this relationship entirely if it points to an already visited collection if ($relatedCollectionId && in_array($relatedCollectionId, $visited)) { continue;