@@ -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 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * ClientLocal constructor. |
| 42 | 42 | * |
| 43 | - * @param $connection |
|
| 43 | + * @param Connection $connection |
|
| 44 | 44 | */ |
| 45 | 45 | public function __construct($connection) |
| 46 | 46 | { |
@@ -194,6 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | /** |
| 196 | 196 | * @inheritDoc |
| 197 | + * @param string $tableName |
|
| 197 | 198 | */ |
| 198 | 199 | public function createEntry($tableName, array $data) |
| 199 | 200 | { |
@@ -205,6 +206,7 @@ discard block |
||
| 205 | 206 | |
| 206 | 207 | /** |
| 207 | 208 | * @inheritDoc |
| 209 | + * @param string $tableName |
|
| 208 | 210 | */ |
| 209 | 211 | public function updateEntry($tableName, $id, array $data) |
| 210 | 212 | { |
@@ -216,6 +218,7 @@ discard block |
||
| 216 | 218 | |
| 217 | 219 | /** |
| 218 | 220 | * @inheritDoc |
| 221 | + * @param string $tableName |
|
| 219 | 222 | */ |
| 220 | 223 | public function deleteEntry($tableName, $ids) |
| 221 | 224 | { |
@@ -192,6 +192,10 @@ |
||
| 192 | 192 | return new HTTPClient(array('base_url' => $this->baseEndpoint)); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | + /** |
|
| 196 | + * @param string $method |
|
| 197 | + * @param string $pathFormat |
|
| 198 | + */ |
|
| 195 | 199 | public function performRequest($method, $pathFormat, $variables = []) |
| 196 | 200 | { |
| 197 | 201 | $request = $this->buildRequest($method, $pathFormat, $variables); |
@@ -237,7 +237,7 @@ |
||
| 237 | 237 | |
| 238 | 238 | if ($query) { |
| 239 | 239 | $q = $request->getQuery(); |
| 240 | - foreach($query as $key => $value) { |
|
| 240 | + foreach ($query as $key => $value) { |
|
| 241 | 241 | $q->set($key, $value); |
| 242 | 242 | } |
| 243 | 243 | } |
@@ -192,6 +192,7 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | 194 | * @inheritDoc |
| 195 | + * @param string $tableName |
|
| 195 | 196 | */ |
| 196 | 197 | public function createEntry($tableName, array $data) |
| 197 | 198 | { |
@@ -203,6 +204,7 @@ discard block |
||
| 203 | 204 | |
| 204 | 205 | /** |
| 205 | 206 | * @inheritDoc |
| 207 | + * @param string $tableName |
|
| 206 | 208 | */ |
| 207 | 209 | public function updateEntry($tableName, $id, array $data) |
| 208 | 210 | { |
@@ -214,6 +216,7 @@ discard block |
||
| 214 | 216 | |
| 215 | 217 | /** |
| 216 | 218 | * @inheritDoc |
| 219 | + * @param string $tableName |
|
| 217 | 220 | */ |
| 218 | 221 | public function deleteEntry($tableName, $ids) |
| 219 | 222 | { |
@@ -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.'); |