mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Check if value has then function when setting result to check external promise types
This commit is contained in:
parent
bb64bcc1c1
commit
9821cc5e18
2 changed files with 3 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue