Пример #1
0
 /**
  * @param array $batch
  * @return BatchRequest
  */
 public static function fromArray(array $batch)
 {
     $requests = [];
     foreach ($batch as $requestArray) {
         if (!is_array($requestArray)) {
             throw new InvalidArgumentException();
         }
         $requests[] = Request::fromArray($requestArray);
     }
     return new self($requests);
 }