public function fromPromise(Promise $promise) { $json = null; $promise->done(function ($data) use(&$json) { $json = $data; }); return new \Zend\Diactoros\Response\JsonResponse($json); }