@@ -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 | { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $tableGateway = $this->getTableGateway($tableName); |
200 | 200 | $data = $this->processData($tableName, $data); |
201 | 201 | |
202 | - foreach($data as $key => $value) { |
|
202 | + foreach ($data as $key => $value) { |
|
203 | 203 | if ($value instanceof File) { |
204 | 204 | $data[$key] = $this->processFile($value); |
205 | 205 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $tableGateway = $this->getTableGateway($tableName); |
219 | 219 | $data = $this->processData($tableName, $data); |
220 | 220 | |
221 | - foreach($data as $key => $value) { |
|
221 | + foreach ($data as $key => $value) { |
|
222 | 222 | if ($value instanceof File) { |
223 | 223 | $data[$key] = $this->processFile($value); |
224 | 224 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $bookmarkData = [ |
326 | 326 | 'section' => 'search', |
327 | 327 | 'title' => $title, |
328 | - 'url' => 'tables/' . $tableName . '/pref/' . $title, |
|
328 | + 'url' => 'tables/'.$tableName.'/pref/'.$title, |
|
329 | 329 | 'user' => $data['user'] |
330 | 330 | ]; |
331 | 331 |
@@ -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 | { |
@@ -276,7 +276,7 @@ |
||
276 | 276 | $bookmarkData = [ |
277 | 277 | 'section' => 'search', |
278 | 278 | 'title' => $title, |
279 | - 'url' => 'tables/' . $tableName . '/pref/' . $title |
|
279 | + 'url' => 'tables/'.$tableName.'/pref/'.$title |
|
280 | 280 | ]; |
281 | 281 | |
282 | 282 | $path = $this->buildPath(static::TABLE_BOOKMARKS_CREATE_ENDPOINT); |
@@ -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 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | protected function processData($tableName, array $data) |
46 | 46 | { |
47 | - $method = 'processDataOn' . StringUtils::underscoreToCamelCase($tableName, true); |
|
47 | + $method = 'processDataOn'.StringUtils::underscoreToCamelCase($tableName, true); |
|
48 | 48 | if (method_exists($this, $method)) { |
49 | 49 | $data = call_user_func_array([$this, $method], [$data]); |
50 | 50 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $acl = $this->container->get('acl'); |
250 | 250 | $adapter = $this->container->get('connection'); |
251 | 251 | |
252 | - $emitter->addAction('table.insert.directus_groups', function ($data) use ($acl, $adapter) { |
|
252 | + $emitter->addAction('table.insert.directus_groups', function($data) use ($acl, $adapter) { |
|
253 | 253 | $privilegesTable = new DirectusPrivilegesTableGateway($adapter, $acl); |
254 | 254 | |
255 | 255 | $privilegesTable->insertPrivilege([ |
@@ -303,32 +303,32 @@ discard block |
||
303 | 303 | $thumbnailFilenameParts = explode('.', $row['name']); |
304 | 304 | $thumbnailExtension = array_pop($thumbnailFilenameParts); |
305 | 305 | |
306 | - $row['url'] = $fileURL . '/' . $row['name']; |
|
306 | + $row['url'] = $fileURL.'/'.$row['name']; |
|
307 | 307 | if (in_array($thumbnailExtension, ['tif', 'tiff', 'psd', 'pdf'])) { |
308 | 308 | $thumbnailExtension = 'jpg'; |
309 | 309 | } |
310 | 310 | |
311 | - $thumbnailFilename = $row['id'] . '.' . $thumbnailExtension; |
|
312 | - $row['thumbnail_url'] = $thumbnailURL . '/' . $thumbnailFilename; |
|
311 | + $thumbnailFilename = $row['id'].'.'.$thumbnailExtension; |
|
312 | + $row['thumbnail_url'] = $thumbnailURL.'/'.$thumbnailFilename; |
|
313 | 313 | |
314 | 314 | // filename-ext-100-100-true.jpg |
315 | 315 | // @TODO: This should be another hook listener |
316 | 316 | $row['thumbnail_url'] = null; |
317 | 317 | $filename = implode('.', $thumbnailFilenameParts); |
318 | 318 | if ($row['type'] == 'embed/vimeo') { |
319 | - $oldThumbnailFilename = $row['name'] . '-vimeo-220-124-true.jpg'; |
|
319 | + $oldThumbnailFilename = $row['name'].'-vimeo-220-124-true.jpg'; |
|
320 | 320 | } else { |
321 | - $oldThumbnailFilename = $filename . '-' . $thumbnailExtension . '-160-160-true.jpg'; |
|
321 | + $oldThumbnailFilename = $filename.'-'.$thumbnailExtension.'-160-160-true.jpg'; |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | // 314551321-vimeo-220-124-true.jpg |
325 | 325 | // hotfix: there's not thumbnail for this file |
326 | - if ($files->exists('thumbs/' . $oldThumbnailFilename)) { |
|
327 | - $row['thumbnail_url'] = $thumbnailURL . '/' . $oldThumbnailFilename; |
|
326 | + if ($files->exists('thumbs/'.$oldThumbnailFilename)) { |
|
327 | + $row['thumbnail_url'] = $thumbnailURL.'/'.$oldThumbnailFilename; |
|
328 | 328 | } |
329 | 329 | |
330 | - if ($files->exists('thumbs/' . $thumbnailFilename)) { |
|
331 | - $row['thumbnail_url'] = $thumbnailURL . '/' . $thumbnailFilename; |
|
330 | + if ($files->exists('thumbs/'.$thumbnailFilename)) { |
|
331 | + $row['thumbnail_url'] = $thumbnailURL.'/'.$thumbnailFilename; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | /* |
@@ -13,7 +13,9 @@ |
||
13 | 13 | $data = []; |
14 | 14 | foreach ($array as $name => $value) { |
15 | 15 | $row = ['name' => $name, 'value' => $value]; |
16 | - if (isset($keys)) $row = array_merge($row, $keys); |
|
16 | + if (isset($keys)) { |
|
17 | + $row = array_merge($row, $keys); |
|
18 | + } |
|
17 | 19 | array_push($data, $row); |
18 | 20 | } |
19 | 21 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | $this->path = $path; |
30 | 30 | |
31 | - foreach($attributes as $attribute) { |
|
31 | + foreach ($attributes as $attribute) { |
|
32 | 32 | if (property_exists($this, $attribute)) { |
33 | 33 | $this->{$attribute} = $attribute; |
34 | 34 | } |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | if (file_exists($path)) { |
78 | 78 | $ext = pathinfo($path, PATHINFO_EXTENSION); |
79 | 79 | $mimeType = mime_content_type($path); |
80 | - $attributes['name'] = pathinfo($path, PATHINFO_FILENAME) . '.' . $ext; |
|
80 | + $attributes['name'] = pathinfo($path, PATHINFO_FILENAME).'.'.$ext; |
|
81 | 81 | $attributes['type'] = $mimeType; |
82 | 82 | $content = file_get_contents($path); |
83 | - $base64 = 'data:' . $mimeType . ';base64,' . base64_encode($content); |
|
83 | + $base64 = 'data:'.$mimeType.';base64,'.base64_encode($content); |
|
84 | 84 | $attributes['data'] = $base64; |
85 | 85 | } else { |
86 | 86 | throw new \Exception('Missing "file" or "data" attribute.'); |