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
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 3 additions and 3 deletions

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 {

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;
}