From 9821cc5e183e7e79c52160da1bb7e02d2689e026 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 12 Oct 2022 21:48:58 +1300 Subject: [PATCH] Check if value has `then` function when setting result to check external promise types --- src/Appwrite/GraphQL/Schema.php | 4 ++-- src/Appwrite/Promises/Promise.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index fcab39701c..08f1b15c2d 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -69,7 +69,7 @@ class Schema * @return array * @throws \Exception */ - public static function api(App $utopia): array + protected static function api(App $utopia): array { Mapper::init($utopia ->getResource('response') @@ -123,7 +123,7 @@ class Schema * @return array * @throws \Exception */ - public static function collections( + protected static function collections( App $utopia, Database $dbForProject ): array { diff --git a/src/Appwrite/Promises/Promise.php b/src/Appwrite/Promises/Promise.php index 3d345c6db1..a6b1aa79d5 100644 --- a/src/Appwrite/Promises/Promise.php +++ b/src/Appwrite/Promises/Promise.php @@ -132,7 +132,7 @@ abstract class Promise */ protected function setResult(mixed $value): void { - if (!$value instanceof self) { + if (!\is_callable([$value, 'then'])) { $this->result = $value; return; }