@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public function __construct($data) |
41 | 41 | { |
42 | 42 | $this->rawData = $data; |
43 | - foreach($data as $field => $value) { |
|
43 | + foreach ($data as $field => $value) { |
|
44 | 44 | if (isset($value['rows'])) { |
45 | 45 | $this->data[$field] = new EntryCollection($value); |
46 | 46 | } else if (is_array($value)) { |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | return $this->data[$name]; |
106 | 106 | } |
107 | 107 | |
108 | - throw new \InvalidArgumentException('Invalid property: ' . $name); |
|
108 | + throw new \InvalidArgumentException('Invalid property: '.$name); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | public function __set($name, $value) |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | $rows = isset($data['rows']) ? $data['rows'] : []; |
48 | 48 | $items = []; |
49 | - foreach($rows as $row) { |
|
49 | + foreach ($rows as $row) { |
|
50 | 50 | $items[] = new Entry($row); |
51 | 51 | } |
52 | 52 |
@@ -220,20 +220,20 @@ |
||
220 | 220 | $path = $data['file']; |
221 | 221 | $ext = pathinfo($path, PATHINFO_EXTENSION); |
222 | 222 | $mimeType = mime_content_type($path); |
223 | - $attributes['name'] = pathinfo($path, PATHINFO_FILENAME) . '.' . $ext; |
|
223 | + $attributes['name'] = pathinfo($path, PATHINFO_FILENAME).'.'.$ext; |
|
224 | 224 | $attributes['type'] = $mimeType; |
225 | 225 | $content = file_get_contents($path); |
226 | - $base64 = 'data:' . $mimeType . ';base64,' . base64_encode($content); |
|
226 | + $base64 = 'data:'.$mimeType.';base64,'.base64_encode($content); |
|
227 | 227 | $attributes['data'] = $base64; |
228 | 228 | unset($data['file']); |
229 | 229 | } else if (ArrayUtils::has($data, 'data')) { |
230 | 230 | $finfo = new \finfo(FILEINFO_MIME); |
231 | 231 | list($mimeType, $charset) = explode('; charset=', $finfo->buffer($data['data'])); |
232 | - $base64 = 'data:' . $mimeType . ';base64,' . base64_encode($data['data']); |
|
232 | + $base64 = 'data:'.$mimeType.';base64,'.base64_encode($data['data']); |
|
233 | 233 | list($type, $subtype) = explode('/', $mimeType); |
234 | 234 | $attributes['data'] = $base64; |
235 | 235 | $attributes['type'] = $mimeType; |
236 | - $attributes['name'] = StringUtils::randomString() . '.' . $subtype; |
|
236 | + $attributes['name'] = StringUtils::randomString().'.'.$subtype; |
|
237 | 237 | unset($data['data']); |
238 | 238 | } else { |
239 | 239 | throw new \Exception('Missing "file" or "data" attribute.'); |
@@ -115,18 +115,18 @@ discard block |
||
115 | 115 | |
116 | 116 | if (isset($options['base_url'])) { |
117 | 117 | $this->baseUrl = rtrim($options['base_url'], '/'); |
118 | - $this->baseEndpoint = $this->baseUrl . '/api'; |
|
118 | + $this->baseEndpoint = $this->baseUrl.'/api'; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | $instanceKey = isset($options['instance_key']) ? $options['instance_key'] : false; |
122 | 122 | if ($instanceKey) { |
123 | 123 | $this->instanceKey = $instanceKey; |
124 | 124 | $this->baseUrl = sprintf($this->hostedBaseUrlFormat, $instanceKey); |
125 | - $this->baseEndpoint = $this->baseUrl . '/api'; |
|
125 | + $this->baseEndpoint = $this->baseUrl.'/api'; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | $this->apiVersion = isset($options['version']) ? $options['version'] : 1; |
129 | - $this->baseEndpoint .= '/' . $this->getAPIVersion(); |
|
129 | + $this->baseEndpoint .= '/'.$this->getAPIVersion(); |
|
130 | 130 | |
131 | 131 | $this->setHTTPClient($this->getDefaultHTTPClient()); |
132 | 132 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function getDefaultHTTPClient() |
220 | 220 | { |
221 | - return new HTTPClient(array('base_url' => rtrim($this->baseEndpoint, '/') . '/')); |
|
221 | + return new HTTPClient(array('base_url' => rtrim($this->baseEndpoint, '/').'/')); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | public function performRequest($method, $pathFormat, $variables = [], array $body = [], array $query = []) |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | |
265 | 265 | if ($query) { |
266 | 266 | $q = $request->getQuery(); |
267 | - foreach($query as $key => $value) { |
|
267 | + foreach ($query as $key => $value) { |
|
268 | 268 | $q->set($key, $value); |
269 | 269 | } |
270 | 270 | } |