Completed
Push — master ( 406ee6...c6d2a0 )
by
unknown
08:12
created
src/Charcoal/Admin/AdminWidget.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
         }
297 297
 
298 298
         if (!is_array($sources)) {
299
-            $sources = [ $sources ];
299
+            $sources = [$sources];
300 300
         }
301 301
 
302 302
         foreach ($sources as $ident => $filter) {
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
      */
544 544
     protected function resolveConditionalLogic($condition)
545 545
     {
546
-        if (is_callable([ $this, $condition ])) {
546
+        if (is_callable([$this, $condition])) {
547 547
             return !!$this->{$condition}();
548 548
         } elseif (is_callable($condition)) {
549 549
             return !!$condition();
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
         $validSources = $this->acceptedDataSources();
568 568
 
569 569
         if (is_numeric($sourceIdent) && is_string($sourceFilter)) {
570
-            $sourceIdent   = $sourceFilter;
570
+            $sourceIdent = $sourceFilter;
571 571
             $sourceFilter = null;
572 572
         }
573 573
 
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
      */
602 602
     protected function acceptedDataSources()
603 603
     {
604
-        return [ static::DATA_SOURCE_REQUEST, static::DATA_SOURCE_OBJECT ];
604
+        return [static::DATA_SOURCE_REQUEST, static::DATA_SOURCE_OBJECT];
605 605
     }
606 606
 
607 607
     /**
@@ -649,15 +649,15 @@  discard block
 block discarded – undo
649 649
                 $method = $matches[2];
650 650
 
651 651
                 if ($class === 'parent') {
652
-                    $resolved = [ $this, $class.'::'.$method ];
652
+                    $resolved = [$this, $class.'::'.$method];
653 653
                 } else {
654 654
                     if (!class_exists($class)) {
655 655
                         return null;
656 656
                     }
657
-                    $resolved = [ $class, $method ];
657
+                    $resolved = [$class, $method];
658 658
                 }
659 659
             } else {
660
-                $resolved = [ $this, $toResolve ];
660
+                $resolved = [$this, $toResolve];
661 661
             }
662 662
         }
663 663
 
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
         foreach ($sources as $sourceIdent) {
681 681
             $filter = $this->dataSourceFilter($sourceIdent);
682 682
             $getter = $this->camelize('data_from_'.$sourceIdent);
683
-            $method = [ $this, $getter ];
683
+            $method = [$this, $getter];
684 684
 
685 685
             if (is_callable($method)) {
686 686
                 $data = call_user_func($method);
Please login to merge, or discard this patch.
src/Charcoal/Admin/Action/Filesystem/LoadAction.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,6 @@
 block discarded – undo
35 35
  * - `name` (_string_) — The custom file name.
36 36
  * - `disposition` (_string_) ["inline"] — How the response should be treated.
37 37
  *   Available options: "inline", "attachment".
38
-
39 38
  * ## Response
40 39
  *
41 40
  * - {@see Psr\Http\Message\StreamInterface} - A streamed response for the given file.
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     protected function validDataFromRequest()
137 137
     {
138
-        return [ 'disk', 'disposition', 'path', 'name' ];
138
+        return ['disk', 'disposition', 'path', 'name'];
139 139
     }
140 140
 
141 141
     /**
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
             $disk = $this->getParam('disk', $this->filesystemConfig['default_connection']);
199 199
             $this->assertValidDisk($disk);
200 200
 
201
-            $disp =  $this->getParam('disposition', self::DISPOSITION_INLINE);
201
+            $disp = $this->getParam('disposition', self::DISPOSITION_INLINE);
202 202
             $this->assertValidDisposition($disp);
203 203
 
204 204
             $path = $this->getParam('path');
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
      */
282 282
     public function generateHttpDisposition($disposition, $filename, $filenameFallback = '')
283 283
     {
284
-        if (!in_array($disposition, [ self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE ])) {
284
+        if (!in_array($disposition, [self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE])) {
285 285
             throw new InvalidArgumentException(sprintf(
286 286
                 'The disposition must be either "%s" or "%s".',
287 287
                 self::DISPOSITION_ATTACHMENT,
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
     {
439 439
         $translator = $this->translator();
440 440
 
441
-        if (!in_array($disposition, [ self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE ])) {
441
+        if (!in_array($disposition, [self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE])) {
442 442
             throw new InvalidArgumentException(sprintf(
443 443
                 'The disposition must be either "%s" or "%s".',
444 444
                 self::DISPOSITION_ATTACHMENT,
Please login to merge, or discard this patch.
src/Charcoal/Admin/Template/System/StaticWebsiteTemplate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             return 0;
92 92
         }
93 93
         $base = log($size, 1024);
94
-        $suffixes = [ 'bytes', 'k', 'M', 'G', 'T' ];
94
+        $suffixes = ['bytes', 'k', 'M', 'G', 'T'];
95 95
 
96 96
         $floor = floor($base);
97 97
         return round(pow(1024, ($base - $floor)), 2).' '.$suffixes[$floor];
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     private function globRecursive($dir, $pattern, $flags = 0)
107 107
     {
108 108
         $files = glob($dir.'/'.$pattern, $flags);
109
-        foreach (glob($dir.'/*', (GLOB_ONLYDIR|GLOB_NOSORT)) as $dir) {
109
+        foreach (glob($dir.'/*', (GLOB_ONLYDIR | GLOB_NOSORT)) as $dir) {
110 110
             $files = array_merge($files, $this->globRecursive($dir, $pattern, $flags));
111 111
         }
112 112
         return $files;
Please login to merge, or discard this patch.
src/Charcoal/Admin/Action/ElfinderConnectorAction.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     protected function validDataFromRequest()
166 166
     {
167
-        return [ 'obj_type', 'obj_id', 'property' ];
167
+        return ['obj_type', 'obj_id', 'property'];
168 168
     }
169 169
 
170 170
     /**
@@ -324,8 +324,8 @@  discard block
 block discarded – undo
324 324
 
325 325
             'uploadDeny'      => $this->defaultUploadDeny(),
326 326
             'uploadAllow'     => $this->defaultUploadAllow(),
327
-            'uploadOrder'     => [ 'deny', 'allow' ],
328
-            'accessControl'   => [ $this, 'checkAccess' ],
327
+            'uploadOrder'     => ['deny', 'allow'],
328
+            'accessControl'   => [$this, 'checkAccess'],
329 329
             'duplicateSuffix' => '_%s_'
330 330
         ];
331 331
     }
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
                 $disk['startPath'] = $startPath;
476 476
             }
477 477
 
478
-            return [ $disk ];
478
+            return [$disk];
479 479
         }
480 480
 
481 481
         return $this->getPublicRoots();
Please login to merge, or discard this patch.
src/Charcoal/Admin/Template/ElfinderTemplate.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             }
286 286
         }
287 287
 
288
-        return json_encode($i18n, (JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
288
+        return json_encode($i18n, (JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
289 289
     }
290 290
 
291 291
     /**
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
             $settings['rememberLastDir'] = !($property instanceof FileProperty);
408 408
         }
409 409
 
410
-        return json_encode($settings, (JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
410
+        return json_encode($settings, (JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
411 411
     }
412 412
 
413 413
     /**
@@ -429,8 +429,7 @@  discard block
 block discarded – undo
429 429
     public function disableTheme()
430 430
     {
431 431
         return isset($this->elfinderConfig['disable_theme']) ?
432
-            !!$this->elfinderConfig['disable_theme'] :
433
-            false;
432
+            !!$this->elfinderConfig['disable_theme'] : false;
434 433
     }
435 434
 
436 435
     /**
Please login to merge, or discard this patch.
src/Charcoal/Admin/Ui/Sidemenu/SidemenuGroupTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                 return $this;
228 228
             }
229 229
 
230
-            $isSelected = $this->sidemenu()->isCurrentItem([ $linkIdent, (string)$url ]);
230
+            $isSelected = $this->sidemenu()->isCurrentItem([$linkIdent, (string)$url]);
231 231
 
232 232
             if ($isSelected) {
233 233
                 $this->isSelected(true);
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
      */
349 349
     public function displayAsPanel()
350 350
     {
351
-        return in_array($this->displayType(), [ 'panel', 'collapsible' ]);
351
+        return in_array($this->displayType(), ['panel', 'collapsible']);
352 352
     }
353 353
 
354 354
     /**
Please login to merge, or discard this patch.
src/Charcoal/Admin/Ui/ActionContainerTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             }
67 67
         }
68 68
 
69
-        usort($parsedActions, [ $this, 'sortActionsByPriority' ]);
69
+        usort($parsedActions, [$this, 'sortActionsByPriority']);
70 70
 
71 71
         while (($first = reset($parsedActions)) && $first['isSeparator']) {
72 72
             array_shift($parsedActions);
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             $action = $this->defaultActionStruct();
166 166
             $action['isSeparator'] = true;
167 167
         } elseif (is_array($action)) {
168
-            $buttonTypes = [ 'button', 'menu', 'reset', 'submit' ];
168
+            $buttonTypes = ['button', 'menu', 'reset', 'submit'];
169 169
             // Normalize structure keys
170 170
             foreach ($action as $key => $val) {
171 171
                 $attr = $this->camelize($key);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             if (isset($action['label'])) {
194 194
                 $action['label'] = $this->translator()->translation($action['label']);
195 195
             } else {
196
-                $action['label'] = ucwords(str_replace([ '.', '_' ], ' ', $action['ident']));
196
+                $action['label'] = ucwords(str_replace(['.', '_'], ' ', $action['ident']));
197 197
 
198 198
                 $model = $this->getActionRenderer();
199 199
                 if ($model) {
@@ -370,9 +370,9 @@  discard block
 block discarded – undo
370 370
             }
371 371
 
372 372
             $result = null;
373
-            if ($renderer && is_callable([ $renderer, $condition ])) {
373
+            if ($renderer && is_callable([$renderer, $condition])) {
374 374
                 $result = !!$renderer->{$condition}();
375
-            } elseif (is_callable([ $this, $condition ])) {
375
+            } elseif (is_callable([$this, $condition])) {
376 376
                 $result = !!$this->{$condition}();
377 377
             } elseif (is_callable($condition)) {
378 378
                 $result = !!$condition();
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
                 $url = preg_replace('~\{\{\s*(obj_)?type\s*\}\}~', $objType, $url);
428 428
             }
429 429
 
430
-            if ($url && strpos($url, ':') === false && !in_array($url[0], [ '/', '#', '?' ])) {
430
+            if ($url && strpos($url, ':') === false && !in_array($url[0], ['/', '#', '?'])) {
431 431
                 $url = $this->adminUrl().$url;
432 432
             }
433 433
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         } elseif ($renderer instanceof ViewableInterface) {
436 436
             $url = $renderer->renderTemplate($url);
437 437
 
438
-            if ($url && strpos($url, ':') === false && !in_array($url[0], [ '/', '#', '?' ])) {
438
+            if ($url && strpos($url, ':') === false && !in_array($url[0], ['/', '#', '?'])) {
439 439
                 $url = $this->adminUrl().$url;
440 440
             }
441 441
         }
Please login to merge, or discard this patch.
src/Charcoal/Admin/Widget/CollectionMapWidget.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                 $loader->setData($collectionConfig);
218 218
             }
219 219
 
220
-            $callback = function(&$obj) {
220
+            $callback = function (&$obj) {
221 221
                 $obj->mapInfoboxTemplate = $this->infoboxTemplate();
222 222
 
223 223
                 if ($this->latProperty() && $this->latProperty()) {
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
         if (is_string($toResolve)) {
455 455
             $model = $this->proto();
456 456
 
457
-            $resolved = [ $model, $toResolve ];
457
+            $resolved = [$model, $toResolve];
458 458
 
459 459
             // check for slim callable as "class:method"
460 460
             $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!';
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
                 $method = $matches[2];
464 464
 
465 465
                 if ($class === 'parent') {
466
-                    $resolved = [ $model, $class.'::'.$method ];
466
+                    $resolved = [$model, $class.'::'.$method];
467 467
                 }
468 468
             }
469 469
 
Please login to merge, or discard this patch.
src/Charcoal/Admin/Widget/FormGroup/ObjectRevisionsFormGroup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
         $lastRevision = $target->latestRevision();
64 64
         $propLabel    = '<span title="%1$s">%2$s</code>';
65 65
 
66
-        $callback = function(&$obj) use ($lastRevision, $target, $propLabel) {
66
+        $callback = function (&$obj) use ($lastRevision, $target, $propLabel) {
67 67
             $dataDiff = $obj->dataDiff();
68 68
             $obj->revTsDisplay = $obj->revTs()->format('Y-m-d H:i:s');
69 69
             $obj->numDiff = count($dataDiff);
70 70
 
71 71
             if (isset($dataDiff[0])) {
72 72
                 $props = array_keys($dataDiff[0]);
73
-                $props = array_diff($props, [ 'last_modified', 'last_modified_by' ]);
73
+                $props = array_diff($props, ['last_modified', 'last_modified_by']);
74 74
 
75 75
                 $changedProps = [];
76 76
                 $droppedProps = [];
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                         $label = $target->p($p)->label();
80 80
                         $changedProps[] = sprintf($propLabel, $p, $label);
81 81
                     } else {
82
-                        $label = ucwords(str_replace([ '.', '_' ], ' ', $p));
82
+                        $label = ucwords(str_replace(['.', '_'], ' ', $p));
83 83
                         $droppedProps[] = sprintf($propLabel, $p, $label);
84 84
                     }
85 85
                 }
Please login to merge, or discard this patch.