Completed
Push — d64 ( 9de643...715811 )
by Welling
02:48
created
src/Response/Entry.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)
Please login to merge, or discard this patch.
src/Response/EntryCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/ClientLocal.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
216 218
 
217 219
     /**
218 220
      * @inheritDoc
221
+     * @param string $tableName
219 222
      */
220 223
     public function deleteEntry($tableName, $ids)
221 224
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         $tableGateway = $this->getTableGateway($tableName);
199 199
         $data = $this->parseData($tableName, $data);
200 200
 
201
-        foreach($data as $key => $value) {
201
+        foreach ($data as $key => $value) {
202 202
             if ($value instanceof File) {
203 203
                 $data[$key] = $this->parseFile($value);
204 204
             }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         $tableGateway = $this->getTableGateway($tableName);
218 218
         $data = $this->parseData($tableName, $data);
219 219
 
220
-        foreach($data as $key => $value) {
220
+        foreach ($data as $key => $value) {
221 221
             if ($value instanceof File) {
222 222
                 $data[$key] = $this->parseFile($value);
223 223
             }
Please login to merge, or discard this patch.
src/ClientRemote.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -192,6 +192,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
214 216
 
215 217
     /**
216 218
      * @inheritDoc
219
+     * @param string $tableName
217 220
      */
218 221
     public function deleteEntry($tableName, $ids)
219 222
     {
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
9 9
  */
10 10
 
11 11
 namespace Directus\SDK;
12
-use Directus\Util\ArrayUtils;
13
-use Directus\Util\StringUtils;
14 12
 
15 13
 /**
16 14
  * Client Remote
Please login to merge, or discard this patch.
src/BaseClientRemote.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -115,18 +115,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/File.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@
 block discarded – undo
38 38
         if (file_exists($path)) {
39 39
             $ext = pathinfo($path, PATHINFO_EXTENSION);
40 40
             $mimeType = mime_content_type($path);
41
-            $attributes['name'] = pathinfo($path, PATHINFO_FILENAME) . '.' . $ext;
41
+            $attributes['name'] = pathinfo($path, PATHINFO_FILENAME).'.'.$ext;
42 42
             $attributes['type'] = $mimeType;
43 43
             $content = file_get_contents($path);
44
-            $base64 = 'data:' . $mimeType . ';base64,' . base64_encode($content);
44
+            $base64 = 'data:'.$mimeType.';base64,'.base64_encode($content);
45 45
             $attributes['data'] = $base64;
46 46
         } else {
47 47
             throw new \Exception('Missing "file" or "data" attribute.');
Please login to merge, or discard this patch.
src/AbstractClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 
45 45
     protected function parseData($tableName, array $data)
46 46
     {
47
-        $method = 'parseOn' . StringUtils::underscoreToCamelCase($tableName, true);
47
+        $method = 'parseOn'.StringUtils::underscoreToCamelCase($tableName, true);
48 48
         if (method_exists($this, $method)) {
49 49
             $data = call_user_func_array([$this, $method], [$data]);
50 50
         }
Please login to merge, or discard this patch.
src/ClientFactory.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 
247 247
         $emitter = new Emitter();
248 248
 
249
-        $emitter->addAction('table.insert.directus_groups', function ($data) {
249
+        $emitter->addAction('table.insert.directus_groups', function($data) {
250 250
             $acl = Bootstrap::get('acl');
251 251
             $zendDb = Bootstrap::get('zendDb');
252 252
             $privilegesTable = new DirectusPrivilegesTableGateway($zendDb, $acl);
@@ -302,32 +302,32 @@  discard block
 block discarded – undo
302 302
                     $thumbnailFilenameParts = explode('.', $row['name']);
303 303
                     $thumbnailExtension = array_pop($thumbnailFilenameParts);
304 304
 
305
-                    $row['url'] = $fileURL . '/' . $row['name'];
305
+                    $row['url'] = $fileURL.'/'.$row['name'];
306 306
                     if (in_array($thumbnailExtension, ['tif', 'tiff', 'psd', 'pdf'])) {
307 307
                         $thumbnailExtension = 'jpg';
308 308
                     }
309 309
 
310
-                    $thumbnailFilename = $row['id'] . '.' . $thumbnailExtension;
311
-                    $row['thumbnail_url'] = $thumbnailURL . '/' . $thumbnailFilename;
310
+                    $thumbnailFilename = $row['id'].'.'.$thumbnailExtension;
311
+                    $row['thumbnail_url'] = $thumbnailURL.'/'.$thumbnailFilename;
312 312
 
313 313
                     // filename-ext-100-100-true.jpg
314 314
                     // @TODO: This should be another hook listener
315 315
                     $row['thumbnail_url'] = null;
316 316
                     $filename = implode('.', $thumbnailFilenameParts);
317 317
                     if ($row['type'] == 'embed/vimeo') {
318
-                        $oldThumbnailFilename = $row['name'] . '-vimeo-220-124-true.jpg';
318
+                        $oldThumbnailFilename = $row['name'].'-vimeo-220-124-true.jpg';
319 319
                     } else {
320
-                        $oldThumbnailFilename = $filename . '-' . $thumbnailExtension . '-160-160-true.jpg';
320
+                        $oldThumbnailFilename = $filename.'-'.$thumbnailExtension.'-160-160-true.jpg';
321 321
                     }
322 322
 
323 323
                     // 314551321-vimeo-220-124-true.jpg
324 324
                     // hotfix: there's not thumbnail for this file
325
-                    if ($files->exists('thumbs/' . $oldThumbnailFilename)) {
326
-                        $row['thumbnail_url'] = $thumbnailURL . '/' . $oldThumbnailFilename;
325
+                    if ($files->exists('thumbs/'.$oldThumbnailFilename)) {
326
+                        $row['thumbnail_url'] = $thumbnailURL.'/'.$oldThumbnailFilename;
327 327
                     }
328 328
 
329
-                    if ($files->exists('thumbs/' . $thumbnailFilename)) {
330
-                        $row['thumbnail_url'] = $thumbnailURL . '/' . $thumbnailFilename;
329
+                    if ($files->exists('thumbs/'.$thumbnailFilename)) {
330
+                        $row['thumbnail_url'] = $thumbnailURL.'/'.$thumbnailFilename;
331 331
                     }
332 332
 
333 333
                     /*
Please login to merge, or discard this patch.