@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require __DIR__.'/vendor/autoload.php'; |
|
| 3 | +require __DIR__ . '/vendor/autoload.php'; |
|
@@ -28,7 +28,7 @@ |
||
| 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 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $data = $data['data']; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - foreach($data as $field => $value) { |
|
| 56 | + foreach ($data as $field => $value) { |
|
| 57 | 57 | if (isset($value['rows']) || (isset($value['data']) && ArrayUtils::isNumericKeys($value['data']))) { |
| 58 | 58 | $this->data[$field] = new EntryCollection($value); |
| 59 | 59 | } else if (is_array($value)) { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function jsonSerialize() |
| 135 | 135 | { |
| 136 | - return (object) [ |
|
| 136 | + return (object)[ |
|
| 137 | 137 | 'metadata' => $this->getMetaData(), |
| 138 | 138 | 'data' => $this->getData() |
| 139 | 139 | ]; |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | public function isPsr7Version() |
| 260 | 260 | { |
| 261 | - return (bool) version_compare(HTTPClient::VERSION, '6.0.0', '>='); |
|
| 261 | + return (bool)version_compare(HTTPClient::VERSION, '6.0.0', '>='); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | /** |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $query = ArrayUtils::get($options, 'query'); |
| 372 | 372 | if ($query) { |
| 373 | 373 | $q = $request->getQuery(); |
| 374 | - foreach($query as $key => $value) { |
|
| 374 | + foreach ($query as $key => $value) { |
|
| 375 | 375 | $q->set($key, $value); |
| 376 | 376 | } |
| 377 | 377 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | 'thumbnail_size', 'thumbnail_quality', 'thumbnail_crop_enabled' |
| 215 | 215 | ]); |
| 216 | 216 | }); |
| 217 | - $container->set('app.settings', function (Container $container) { |
|
| 217 | + $container->set('app.settings', function(Container $container) { |
|
| 218 | 218 | $DirectusSettingsTableGateway = new \Zend\Db\TableGateway\TableGateway('directus_settings', $container->get('zendDb')); |
| 219 | 219 | $rowSet = $DirectusSettingsTableGateway->select(); |
| 220 | 220 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | return $settings; |
| 227 | 227 | }); |
| 228 | 228 | |
| 229 | - $container->singleton('hashManager', function () { |
|
| 229 | + $container->singleton('hashManager', function() { |
|
| 230 | 230 | return new HashManager(); |
| 231 | 231 | }); |
| 232 | 232 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $acl = $this->container->get('acl'); |
| 270 | 270 | $adapter = $this->container->get('connection'); |
| 271 | 271 | |
| 272 | - $emitter->addAction('table.insert.directus_groups', function ($data) use ($acl, $adapter) { |
|
| 272 | + $emitter->addAction('table.insert.directus_groups', function($data) use ($acl, $adapter) { |
|
| 273 | 273 | $privilegesTable = new DirectDirectusPrivilegesTableGateway($adapter, $acl); |
| 274 | 274 | |
| 275 | 275 | $privilegesTable->insertPrivilege([ |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | ]); |
| 286 | 286 | }); |
| 287 | 287 | |
| 288 | - $emitter->addFilter('table.insert.directus_files:before', function ($payload) { |
|
| 288 | + $emitter->addFilter('table.insert.directus_files:before', function($payload) { |
|
| 289 | 289 | unset($payload['data']); |
| 290 | 290 | $payload['user'] = 1; |
| 291 | 291 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | // Add file url and thumb url |
| 296 | 296 | $config = $this->container->get('config'); |
| 297 | 297 | $files = $this->container->get('files'); |
| 298 | - $emitter->addFilter('table.select', function ($payload) use ($config, $files) { |
|
| 298 | + $emitter->addFilter('table.select', function($payload) use ($config, $files) { |
|
| 299 | 299 | $selectState = $payload->attribute('selectState'); |
| 300 | 300 | |
| 301 | 301 | if ($selectState['table'] == 'directus_files') { |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | $tableGateway = $this->getTableGateway($tableName); |
| 254 | 254 | $data = $this->processData($tableName, $data); |
| 255 | 255 | |
| 256 | - foreach($data as $key => $value) { |
|
| 256 | + foreach ($data as $key => $value) { |
|
| 257 | 257 | if ($value instanceof File) { |
| 258 | 258 | $data[$key] = $this->processFile($value); |
| 259 | 259 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | $tableGateway = $this->getTableGateway($tableName); |
| 273 | 273 | $data = $this->processData($tableName, $data); |
| 274 | 274 | |
| 275 | - foreach($data as $key => $value) { |
|
| 275 | + foreach ($data as $key => $value) { |
|
| 276 | 276 | if ($value instanceof File) { |
| 277 | 277 | $data[$key] = $this->processFile($value); |
| 278 | 278 | } |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | $success = $tableGateway->dropColumn($name); |
| 638 | 638 | |
| 639 | 639 | $response = [ |
| 640 | - 'success' => (bool) $success |
|
| 640 | + 'success' => (bool)$success |
|
| 641 | 641 | ]; |
| 642 | 642 | |
| 643 | 643 | if (!$success) { |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | $success = $tableGateway->drop(); |
| 667 | 667 | |
| 668 | 668 | $response = [ |
| 669 | - 'success' => (bool) $success |
|
| 669 | + 'success' => (bool)$success |
|
| 670 | 670 | ]; |
| 671 | 671 | |
| 672 | 672 | if (!$success) { |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | */ |
| 695 | 695 | public function getRandom(array $options = []) |
| 696 | 696 | { |
| 697 | - $length = (int) ArrayUtils::get($options, 'length', 32); |
|
| 697 | + $length = (int)ArrayUtils::get($options, 'length', 32); |
|
| 698 | 698 | |
| 699 | 699 | return $this->createResponseFromData([ |
| 700 | 700 | 'success' => true, |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | function sorting_by_key($key, $order = 'ASC') |
| 48 | 48 | { |
| 49 | - return function ($a, $b) use ($key, $order) { |
|
| 49 | + return function($a, $b) use ($key, $order) { |
|
| 50 | 50 | if ($a[$key] === $b[$key]) { |
| 51 | 51 | return 0; |
| 52 | 52 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $rows = $this->pickRows($data); |
| 48 | 48 | $items = []; |
| 49 | - foreach($rows as $row) { |
|
| 49 | + foreach ($rows as $row) { |
|
| 50 | 50 | $items[] = new Entry($row); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public function toArray() |
| 168 | 168 | { |
| 169 | - return $this-getRawData(); |
|
| 169 | + return $this - getRawData(); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public function jsonSerialize() |
| 178 | 178 | { |
| 179 | - return (object) [ |
|
| 179 | + return (object)[ |
|
| 180 | 180 | 'meta' => $this->metadata, |
| 181 | 181 | 'data' => $this->items |
| 182 | 182 | ]; |