GraphQL\Executor\Promise\Promise::then PHP Метод

then() публичный Метод

public then ( callable $onFullFilled = null, callable $onRejected = null ) : GraphQL\Executor\Promise\Promise
$onFullFilled callable
$onRejected callable
Результат GraphQL\Executor\Promise\Promise
    public function then(callable $onFullFilled = null, callable $onRejected = null);

Usage Example

Пример #1
0
 /**
  * @param \GraphQL\Executor\Promise\Promise $promise
  * @return array
  */
 private static function awaitPromise($promise)
 {
     $results = null;
     $promise->then(function (ExecutionResult $executionResult) use(&$results) {
         $results = $executionResult->toArray();
     });
     return $results;
 }
Promise