@@ -32,13 +32,13 @@ |
||
| 32 | 32 | * @throws RequiredOptionsException |
| 33 | 33 | */ |
| 34 | 34 | protected function configureData($data){ |
| 35 | - if (is_string($data)) { |
|
| 36 | - if (!empty($this->Options)) { |
|
| 35 | + if (is_string($data)){ |
|
| 36 | + if (!empty($this->Options)){ |
|
| 37 | 37 | $fileField = end($this->Options); |
| 38 | 38 | $data = array( |
| 39 | 39 | $fileField => $data |
| 40 | 40 | ); |
| 41 | - } else { |
|
| 41 | + } else{ |
|
| 42 | 42 | throw new RequiredOptionsException(get_called_class(), "Options are required, when passing String for data."); |
| 43 | 43 | } |
| 44 | 44 | } |
@@ -30,19 +30,19 @@ |
||
| 30 | 30 | 'method' => '' |
| 31 | 31 | ); |
| 32 | 32 | |
| 33 | - protected function configureData($data) { |
|
| 34 | - if (!isset($data['requests'])) { |
|
| 33 | + protected function configureData($data){ |
|
| 34 | + if (!isset($data['requests'])){ |
|
| 35 | 35 | $requestData = array( |
| 36 | 36 | 'requests' => array() |
| 37 | 37 | ); |
| 38 | 38 | $counter = 0; |
| 39 | - foreach ($data as $key => $EntryPoint) { |
|
| 40 | - if (is_object($EntryPoint)) { |
|
| 39 | + foreach ($data as $key => $EntryPoint){ |
|
| 40 | + if (is_object($EntryPoint)){ |
|
| 41 | 41 | $requestData['requests'][$counter] = $this->bulkRequest; |
| 42 | 42 | $requestData['requests'][$counter]['method'] = $EntryPoint->getRequest()->getType(); |
| 43 | - if ($requestData['requests'][$counter]['method'] == "POST" || $requestData['requests'][$counter]['method'] == "PUT") { |
|
| 43 | + if ($requestData['requests'][$counter]['method'] == "POST" || $requestData['requests'][$counter]['method'] == "PUT"){ |
|
| 44 | 44 | $requestData['requests'][$counter]['data'] = json_encode($EntryPoint->getData()); |
| 45 | - } else { |
|
| 45 | + } else{ |
|
| 46 | 46 | unset($requestData['requests'][$counter]['data']); |
| 47 | 47 | } |
| 48 | 48 | $requestData['requests'][$counter]['headers'] = $EntryPoint->getRequest()->getHeaders(); |