@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | public function setBypassCanMethods(bool $b): SearchApi |
| 162 | 162 | { |
| 163 | - if (! Director::is_cli()) { |
|
| 163 | + if (!Director::is_cli()) { |
|
| 164 | 164 | user_error('setBypassCanMethods() is only available in CLI mode. Use with caution as it will bypass all canView() and canEdit() checks.', E_USER_WARNING); |
| 165 | 165 | } else { |
| 166 | 166 | $this->bypassCanMethods = $b; |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $className = $item->ClassName; |
| 291 | 291 | $fields = $this->getAllValidFields($className); |
| 292 | 292 | foreach ($fields as $field) { |
| 293 | - if (! $this->includeFieldTest($className, $field)) { |
|
| 293 | + if (!$this->includeFieldTest($className, $field)) { |
|
| 294 | 294 | continue; |
| 295 | 295 | } |
| 296 | 296 | if ($type === 'url') { |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | $myStage = Versioned::get_stage(); |
| 346 | 346 | Versioned::set_stage(Versioned::DRAFT); |
| 347 | 347 | // is it on live and is live the same as draft |
| 348 | - $canBePublished = $item->isPublished() && ! $item->isModifiedOnDraft(); |
|
| 348 | + $canBePublished = $item->isPublished() && !$item->isModifiedOnDraft(); |
|
| 349 | 349 | $item->writeToStage(Versioned::DRAFT); |
| 350 | 350 | if ($canBePublished) { |
| 351 | 351 | $item->publishSingle(); |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | |
| 379 | 379 | if (count($this->words) > 0) { |
| 380 | 380 | foreach ($this->getAllDataObjects() as $className) { |
| 381 | - if (! $this->includeClassTest($className)) { |
|
| 381 | + if (!$this->includeClassTest($className)) { |
|
| 382 | 382 | continue; |
| 383 | 383 | } |
| 384 | 384 | |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | $fields = $this->getAllValidFields($className); |
| 387 | 387 | $filterAny = []; |
| 388 | 388 | foreach ($fields as $field) { |
| 389 | - if (! $this->includeFieldTest($className, $field)) { |
|
| 389 | + if (!$this->includeFieldTest($className, $field)) { |
|
| 390 | 390 | continue; |
| 391 | 391 | } |
| 392 | 392 | $filterAny[$field . ':PartialMatch'] = $this->words; |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | $back = $this->config()->get('hours_back_for_recent') ?: 24; |
| 436 | 436 | $limit = $this->Config()->get('limit_per_class_for_recent') ?: 5; |
| 437 | 437 | $threshold = strtotime('-' . $back . ' hours', DBDatetime::now()->getTimestamp()); |
| 438 | - if (! $threshold) { |
|
| 438 | + if (!$threshold) { |
|
| 439 | 439 | $threshold = time() - 86400; |
| 440 | 440 | } |
| 441 | 441 | |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | } |
| 542 | 542 | $finder->saveCache(); |
| 543 | 543 | |
| 544 | - if (! empty($this->sortOverride)) { |
|
| 544 | + if (!empty($this->sortOverride)) { |
|
| 545 | 545 | return $list->sort($this->sortOverride); |
| 546 | 546 | } else { |
| 547 | 547 | return $list->sort(['SiteWideSearchSortValue' => 'ASC']); |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | $testWords = array_unique($testWords); |
| 572 | 572 | foreach ($testWords as $wordKey => $word) { |
| 573 | 573 | //match a exact field to full words / one word |
| 574 | - $fullWords = ! (bool) $wordKey; |
|
| 574 | + $fullWords = !(bool) $wordKey; |
|
| 575 | 575 | if (false === $done) { |
| 576 | 576 | $count = 0; |
| 577 | 577 | foreach ($fieldValues as $fieldValue) { |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | |
| 690 | 690 | protected function includeClassTest(string $className): bool |
| 691 | 691 | { |
| 692 | - if (count($this->includedClassesWithSubClassess) && ! in_array($className, $this->includedClassesWithSubClassess, true)) { |
|
| 692 | + if (count($this->includedClassesWithSubClassess) && !in_array($className, $this->includedClassesWithSubClassess, true)) { |
|
| 693 | 693 | if ($this->debug) { |
| 694 | 694 | DB::alteration_message(' ... Skipping as not included ' . $className); |
| 695 | 695 | } |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | } elseif (count($this->includedFields) > 0) { |
| 716 | 716 | return in_array($field, $this->includedFields, true); |
| 717 | 717 | } elseif (count($this->excludedFields) > 0) { |
| 718 | - return ! in_array($field, $this->includedFields, true); |
|
| 718 | + return !in_array($field, $this->includedFields, true); |
|
| 719 | 719 | } else { |
| 720 | 720 | return false; |
| 721 | 721 | } |