Passed
Push — master ( 081d39...3cb69a )
by Nicolaas
03:44
created
src/Api/SearchApi.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -137,13 +137,13 @@  discard block
 block discarded – undo
137 137
 
138 138
     public function setQuickSearchType(string $s): SearchApi
139 139
     {
140
-        if($s === 'all') {
140
+        if ($s === 'all') {
141 141
             $this->isQuickSearch = false;
142 142
             $this->quickSearchType = '';
143
-        } elseif($s === 'limited') {
143
+        } elseif ($s === 'limited') {
144 144
             $this->isQuickSearch = true;
145 145
             $this->quickSearchType = '';
146
-        } elseif(class_exists($s)) {
146
+        } elseif (class_exists($s)) {
147 147
             $this->quickSearchType = $s;
148 148
             $object = Injector::inst()->get($s);
149 149
             $this->setIncludedClasses($object->getClassesToSearch());
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
                 if ($this->debug) {
352 352
                     DB::alteration_message(' ... Searching in ' . $className);
353 353
                 }
354
-                if(count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) {
354
+                if (count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) {
355 355
                     continue;
356 356
                 }
357 357
                 if (!in_array($className, $this->excludedClasses, true)) {
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                     $fields = $this->getAllValidFields($className);
361 361
                     $filterAny = [];
362 362
                     foreach ($fields as $field) {
363
-                        if(count($this->includedFields) && !in_array($field, $this->includedFields, true)) {
363
+                        if (count($this->includedFields) && !in_array($field, $this->includedFields, true)) {
364 364
                             continue;
365 365
                         }
366 366
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         $array = [];
424 424
         $classNames = $this->getAllDataObjects();
425 425
         foreach ($classNames as $className) {
426
-            if(count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) {
426
+            if (count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) {
427 427
                 continue;
428 428
             }
429 429
             if (!in_array($className, $this->excludedClasses, true)) {
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
         $items = $this->turnArrayIntoObjects($matches);
495 495
         foreach ($items as $item) {
496 496
             $link = $finder->getLink($item, $this->excludedClasses);
497
-            if($item->canView()) {
497
+            if ($item->canView()) {
498 498
                 $cmsEditLink = $item->canEdit() ? $finder->getCMSEditLink($item) : '';
499 499
                 $list->push(
500 500
                     ArrayData::create(
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
         }
516 516
 
517 517
         $finder->saveCache();
518
-        if(!empty($this->sortOverride)) {
518
+        if (!empty($this->sortOverride)) {
519 519
             return $list->sort($this->sortOverride);
520 520
         } else {
521 521
             return $list->sort(['SiteWideSearchSortValue' => 'ASC']);
@@ -675,8 +675,8 @@  discard block
 block discarded – undo
675 675
                 foreach ($fullList as $name => $type) {
676 676
                     if ($this->isValidFieldType($className, $name, $type)) {
677 677
                         $array[] = $name;
678
-                    } elseif(in_array($name, $this->includedFields, true)) {
679
-                        if(in_array($name, $fullList, true)) {
678
+                    } elseif (in_array($name, $this->includedFields, true)) {
679
+                        if (in_array($name, $fullList, true)) {
680 680
                             user_error('Field ' . $name . ' is both included and excluded');
681 681
                         }
682 682
                         $array[] = $name;
Please login to merge, or discard this patch.