@@ -141,13 +141,13 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | public function setQuickSearchType(string $s): SearchApi |
| 143 | 143 | { |
| 144 | - if($s === 'all') { |
|
| 144 | + if ($s === 'all') { |
|
| 145 | 145 | $this->isQuickSearch = false; |
| 146 | 146 | $this->quickSearchType = ''; |
| 147 | - } elseif($s === 'limited') { |
|
| 147 | + } elseif ($s === 'limited') { |
|
| 148 | 148 | $this->isQuickSearch = true; |
| 149 | 149 | $this->quickSearchType = ''; |
| 150 | - } elseif(class_exists($s)) { |
|
| 150 | + } elseif (class_exists($s)) { |
|
| 151 | 151 | $this->quickSearchType = $s; |
| 152 | 152 | $object = Injector::inst()->get($s); |
| 153 | 153 | $this->setIncludedClasses($object->getClassesToSearch()); |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | if ($this->debug) { |
| 364 | 364 | DB::alteration_message(' ... Searching in ' . $className); |
| 365 | 365 | } |
| 366 | - if(count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) { |
|
| 366 | + if (count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) { |
|
| 367 | 367 | continue; |
| 368 | 368 | } |
| 369 | 369 | if (!in_array($className, $this->excludedClasses, true)) { |
@@ -372,9 +372,9 @@ discard block |
||
| 372 | 372 | $fields = $this->getAllValidFields($className); |
| 373 | 373 | $filterAny = []; |
| 374 | 374 | foreach ($fields as $field) { |
| 375 | - if(count($this->includedClassFieldCombos) && isset($this->includedClassFieldCombos[$className][$field])) { |
|
| 375 | + if (count($this->includedClassFieldCombos) && isset($this->includedClassFieldCombos[$className][$field])) { |
|
| 376 | 376 | // all good |
| 377 | - } elseif(count($this->includedFields) && in_array($field, $this->includedFields, true)) { |
|
| 377 | + } elseif (count($this->includedFields) && in_array($field, $this->includedFields, true)) { |
|
| 378 | 378 | // all good |
| 379 | 379 | } elseif (!in_array($field, $this->excludedFields, true)) { |
| 380 | 380 | // all good |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | $array = []; |
| 438 | 438 | $classNames = $this->getAllDataObjects(); |
| 439 | 439 | foreach ($classNames as $className) { |
| 440 | - if(count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) { |
|
| 440 | + if (count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) { |
|
| 441 | 441 | continue; |
| 442 | 442 | } |
| 443 | 443 | if (!in_array($className, $this->excludedClasses, true)) { |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | $items = $this->turnArrayIntoObjects($matches); |
| 509 | 509 | foreach ($items as $item) { |
| 510 | 510 | $link = $finder->getLink($item, $this->excludedClasses); |
| 511 | - if($item->canView()) { |
|
| 511 | + if ($item->canView()) { |
|
| 512 | 512 | $cmsEditLink = $item->canEdit() ? $finder->getCMSEditLink($item) : ''; |
| 513 | 513 | $list->push( |
| 514 | 514 | ArrayData::create( |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | $finder->saveCache(); |
| 532 | - if(!empty($this->sortOverride)) { |
|
| 532 | + if (!empty($this->sortOverride)) { |
|
| 533 | 533 | return $list->sort($this->sortOverride); |
| 534 | 534 | } else { |
| 535 | 535 | return $list->sort(['SiteWideSearchSortValue' => 'ASC']); |
@@ -696,12 +696,12 @@ discard block |
||
| 696 | 696 | foreach ($fullList as $name => $type) { |
| 697 | 697 | if ($this->isValidFieldType($className, $name, $type)) { |
| 698 | 698 | $array[] = $name; |
| 699 | - } elseif(in_array($name, $this->includedFields, true)) { |
|
| 699 | + } elseif (in_array($name, $this->includedFields, true)) { |
|
| 700 | 700 | $array[] = $name; |
| 701 | 701 | } |
| 702 | 702 | } |
| 703 | - if(isset($this->includedClassFieldCombos[$className])) { |
|
| 704 | - foreach($this->includedClassFieldCombos[$className] as $name => $type) { |
|
| 703 | + if (isset($this->includedClassFieldCombos[$className])) { |
|
| 704 | + foreach ($this->includedClassFieldCombos[$className] as $name => $type) { |
|
| 705 | 705 | $array[] = $name; |
| 706 | 706 | } |
| 707 | 707 | } |