Passed
Push — master ( 7d8f18...081d39 )
by Nicolaas
09:10
created
src/Api/SearchApi.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
 
136 136
     public function setQuickSearchType(string $s): SearchApi
137 137
     {
138
-        if($s === 'all') {
138
+        if ($s === 'all') {
139 139
             $this->isQuickSearch = false;
140 140
             $this->quickSearchType = '';
141
-        } elseif($s === 'limited') {
141
+        } elseif ($s === 'limited') {
142 142
             $this->isQuickSearch = true;
143 143
             $this->quickSearchType = '';
144
-        } elseif(class_exists($s)) {
144
+        } elseif (class_exists($s)) {
145 145
             $this->quickSearchType = $s;
146 146
             $object = Injector::inst()->get($s);
147 147
             $this->setIncludedClasses($object->getClassesToSearch());
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
                 if ($this->debug) {
342 342
                     DB::alteration_message(' ... Searching in ' . $className);
343 343
                 }
344
-                if(count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) {
344
+                if (count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) {
345 345
                     continue;
346 346
                 }
347 347
                 if (!in_array($className, $this->excludedClasses, true)) {
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                     $fields = $this->getAllValidFields($className);
351 351
                     $filterAny = [];
352 352
                     foreach ($fields as $field) {
353
-                        if(count($this->includedFields) && !in_array($field, $this->includedFields, true)) {
353
+                        if (count($this->includedFields) && !in_array($field, $this->includedFields, true)) {
354 354
                             continue;
355 355
                         }
356 356
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         $array = [];
414 414
         $classNames = $this->getAllDataObjects();
415 415
         foreach ($classNames as $className) {
416
-            if(count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) {
416
+            if (count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) {
417 417
                 continue;
418 418
             }
419 419
             if (!in_array($className, $this->excludedClasses, true)) {
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
         $items = $this->turnArrayIntoObjects($matches);
485 485
         foreach ($items as $item) {
486 486
             $link = $finder->getLink($item, $this->excludedClasses);
487
-            if($item->canView()) {
487
+            if ($item->canView()) {
488 488
                 $cmsEditLink = $item->canEdit() ? $finder->getCMSEditLink($item) : '';
489 489
                 $list->push(
490 490
                     ArrayData::create(
@@ -661,8 +661,8 @@  discard block
 block discarded – undo
661 661
                 foreach ($fullList as $name => $type) {
662 662
                     if ($this->isValidFieldType($className, $name, $type)) {
663 663
                         $array[] = $name;
664
-                    } elseif(in_array($name, $this->includedFields, true)) {
665
-                        if(in_array($name, $fullList, true)) {
664
+                    } elseif (in_array($name, $this->includedFields, true)) {
665
+                        if (in_array($name, $fullList, true)) {
666 666
                             user_error('Field ' . $name . ' is both included and excluded');
667 667
                         }
668 668
                         $array[] = $name;
Please login to merge, or discard this patch.