Example #1
0
 /**
  * @param RequestExecutorInterface $executor
  * @return Jsonable|null
  */
 public function executeWith(RequestExecutorInterface $executor)
 {
     /** @var Request[] $requests */
     $requests = array_map(function ($requestData) {
         return $this->requestFactory->createRequest($requestData);
     }, $this->batch);
     $response = new BatchResponse();
     foreach ($requests as $request) {
         $requestResponse = $executor->execute($request);
         if (null !== $requestResponse) {
             $response->add($requestResponse);
         }
     }
     return $response;
 }
Example #2
0
 /**
  * @param RequestExecutorInterface $executor
  * @return Jsonable|null
  */
 public function executeWith(RequestExecutorInterface $executor)
 {
     return $executor->execute($this);
 }