From 4d7becc45993f669f2e8f49047c5666c9cc264b0 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 16 Feb 2024 20:23:31 +1300 Subject: [PATCH] Apply suggestions from code review --- src/Appwrite/Migration/Version/V20.php | 8 ++++---- src/Appwrite/Utopia/Response/Filters/V17.php | 2 +- tests/unit/Utopia/Response/Filters/V17Test.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Migration/Version/V20.php b/src/Appwrite/Migration/Version/V20.php index caf3022804..0e7434c56c 100644 --- a/src/Appwrite/Migration/Version/V20.php +++ b/src/Appwrite/Migration/Version/V20.php @@ -77,18 +77,18 @@ class V20 extends Migration // Support database array type migration (user collections) foreach ( $this->documentsIterator('attributes', [ - Query::equal('array', [true]), + Query::equal('array', [true]), ]) as $attribute ) { $foundIndex = false; foreach ( $this->documentsIterator('indexes', [ - Query::equal('databaseInternalId', [$attribute['databaseInternalId']]), - Query::equal('collectionInternalId', [$attribute['collectionInternalId']]), + Query::equal('databaseInternalId', [$attribute['databaseInternalId']]), + Query::equal('collectionInternalId', [$attribute['collectionInternalId']]), ]) as $index ) { if (in_array($attribute['key'], $index['attributes'])) { - $this->projectDB->deleteIndex($index['collectionId'], $index['_uid']); + $this->projectDB->deleteIndex($index['collectionId'], $index['$id']); $foundIndex = true; } } diff --git a/src/Appwrite/Utopia/Response/Filters/V17.php b/src/Appwrite/Utopia/Response/Filters/V17.php index de6ab607b8..cf62bcf488 100644 --- a/src/Appwrite/Utopia/Response/Filters/V17.php +++ b/src/Appwrite/Utopia/Response/Filters/V17.php @@ -42,7 +42,7 @@ class V17 extends Filter protected function parseToken(array $content) { - unset($content['securityPhrase']); + unset($content['phrase']); return $content; } } diff --git a/tests/unit/Utopia/Response/Filters/V17Test.php b/tests/unit/Utopia/Response/Filters/V17Test.php index 68d2146e0a..25f4fb2f2e 100644 --- a/tests/unit/Utopia/Response/Filters/V17Test.php +++ b/tests/unit/Utopia/Response/Filters/V17Test.php @@ -97,7 +97,7 @@ class V17Test extends TestCase return [ 'remove securityPhrase' => [ [ - 'securityPhrase' => 'Lorum Ipsum', + 'phrase' => 'Lorum Ipsum', ], [ ],