done() public method

public done ( callable $onFulfilled = null, callable $onRejected = null )
$onFulfilled callable
$onRejected callable
Example #1
0
 public function fromPromise(Promise $promise)
 {
     $json = null;
     $promise->done(function ($data) use(&$json) {
         $json = $data;
     });
     return new \Zend\Diactoros\Response\JsonResponse($json);
 }