Passed
Push — master ( 4af294...16bfce )
by Nicolaas
04:04
created
src/Api/SearchApi.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                     $className = $item->ClassName;
278 278
                     $fields = $this->getAllValidFields($className);
279 279
                     foreach ($fields as $field) {
280
-                        if (! $this->includeFieldTest($className, $field)) {
280
+                        if (!$this->includeFieldTest($className, $field)) {
281 281
                             continue;
282 282
                         }
283 283
                         if ($type === 'url') {
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
             $myStage = Versioned::get_stage();
333 333
             Versioned::set_stage(Versioned::DRAFT);
334 334
             // is it on live and is live the same as draft
335
-            $canBePublished = $item->isPublished() && ! $item->isModifiedOnDraft();
335
+            $canBePublished = $item->isPublished() && !$item->isModifiedOnDraft();
336 336
             $item->writeToStage(Versioned::DRAFT);
337 337
             if ($canBePublished) {
338 338
                 $item->publishSingle();
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 
366 366
         if (count($this->words) > 0) {
367 367
             foreach ($this->getAllDataObjects() as $className) {
368
-                if (! $this->includeClassTest($className)) {
368
+                if (!$this->includeClassTest($className)) {
369 369
                     continue;
370 370
                 }
371 371
 
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
                 $fields = $this->getAllValidFields($className);
374 374
                 $filterAny = [];
375 375
                 foreach ($fields as $field) {
376
-                    if (! $this->includeFieldTest($className, $field)) {
376
+                    if (!$this->includeFieldTest($className, $field)) {
377 377
                         continue;
378 378
                     }
379 379
                     $filterAny[$field . ':PartialMatch'] = $this->words;
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         $back = $this->config()->get('hours_back_for_recent') ?: 24;
423 423
         $limit = $this->Config()->get('limit_per_class_for_recent') ?: 5;
424 424
         $threshold = strtotime('-' . $back . ' hours', DBDatetime::now()->getTimestamp());
425
-        if (! $threshold) {
425
+        if (!$threshold) {
426 426
             $threshold = time() - 86400;
427 427
         }
428 428
 
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
         }
529 529
         $finder->saveCache();
530 530
 
531
-        if (! empty($this->sortOverride)) {
531
+        if (!empty($this->sortOverride)) {
532 532
             return $list->sort($this->sortOverride);
533 533
         } else {
534 534
             return $list->sort(['SiteWideSearchSortValue' => 'ASC']);
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
             $testWords = array_unique($testWords);
559 559
             foreach ($testWords as $wordKey => $word) {
560 560
                 //match a exact field to full words / one word
561
-                $fullWords = ! (bool) $wordKey;
561
+                $fullWords = !(bool) $wordKey;
562 562
                 if (false === $done) {
563 563
                     $count = 0;
564 564
                     foreach ($fieldValues as $fieldValue) {
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 
677 677
     protected function includeClassTest(string $className): bool
678 678
     {
679
-        if (count($this->includedClassesWithSubClassess) && ! in_array($className, $this->includedClassesWithSubClassess, true)) {
679
+        if (count($this->includedClassesWithSubClassess) && !in_array($className, $this->includedClassesWithSubClassess, true)) {
680 680
             if ($this->debug) {
681 681
                 DB::alteration_message(' ... Skipping as not included ' . $className);
682 682
             }
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
         } elseif (count($this->includedFields) > 0) {
703 703
             return in_array($field, $this->includedFields, true);
704 704
         } elseif (count($this->excludedFields) > 0) {
705
-            return ! in_array($field, $this->includedFields, true);
705
+            return !in_array($field, $this->includedFields, true);
706 706
         } else {
707 707
             return false;
708 708
         }
Please login to merge, or discard this patch.