From 9f2d1afc2acf2b6cdc5088ad4becbab131df0f2a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 9 Oct 2024 23:20:57 +1300 Subject: [PATCH] Merge pull request #53 from utopia-php/validate-uid validate UID fix --- src/Migration/Destinations/Appwrite.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Migration/Destinations/Appwrite.php b/src/Migration/Destinations/Appwrite.php index dc04945..a9e96ba 100644 --- a/src/Migration/Destinations/Appwrite.php +++ b/src/Migration/Destinations/Appwrite.php @@ -313,7 +313,7 @@ protected function createDatabase(Database $resource): bool $validator = new UID(); - if ($validator->isValid($resourceId)) { + if (!$validator->isValid($resourceId)) { throw new Exception( resourceName: $resource->getName(), resourceGroup: $resource->getGroup(), @@ -368,7 +368,7 @@ protected function createCollection(Collection $resource): bool $validator = new UID(); - if ($validator->isValid($resourceId)) { + if (!$validator->isValid($resourceId)) { throw new Exception( resourceName: $resource->getName(), resourceGroup: $resource->getGroup(), @@ -895,7 +895,7 @@ protected function createDocument(Document $resource, bool $isLast): bool { $validator = new UID(); - if ($validator->isValid($resource->getId())) { + if (!$validator->isValid($resource->getId())) { throw new Exception( resourceName: $resource->getName(), resourceGroup: $resource->getGroup(),