Check if value has then function when setting result to check external promise types

This commit is contained in:
Jake Barnby
2022-10-12 21:48:58 +13:00
parent bb64bcc1c1
commit 9821cc5e18
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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 {
+1 -1
View File
@@ -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;
}