Passed
Push — master ( 82d083...2c7632 )
by
unknown
09:02
created
src/Admin/SearchAdmin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             (new CheckboxField('QuickSearch', 'Search Main Fields Only', $this->isQuickSearch))
57 57
                 ->setDescription('This is faster but only searches a limited number of fields')
58 58
         );
59
-        if (! $this->getRequest()->requestVar('Keywords')) {
59
+        if (!$this->getRequest()->requestVar('Keywords')) {
60 60
             $resultsTitle = 'Recently Edited';
61 61
             $this->listHTML = $this->renderWith(self::class . '_Results');
62 62
         } else {
Please login to merge, or discard this patch.
src/Api/SearchApi.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -211,12 +211,12 @@  discard block
 block discarded – undo
211 211
         if (count($this->words)) {
212 212
             foreach ($this->getAllDataObjects() as $className) {
213 213
                 // if ($this->debug) {DB::alteration_message(' ... Searching in ' . $className);}
214
-                if (! in_array($className, $this->excludedClasses, true)) {
214
+                if (!in_array($className, $this->excludedClasses, true)) {
215 215
                     $array[$className] = [];
216 216
                     $fields = $this->getAllValidFields($className);
217 217
                     $filterAny = [];
218 218
                     foreach ($fields as $field) {
219
-                        if (! in_array($field, $this->excludedFields, true)) {
219
+                        if (!in_array($field, $this->excludedFields, true)) {
220 220
                             // if ($this->debug) {DB::alteration_message(' ... ... Searching in ' . $className . '.' . $field);}
221 221
                             $filterAny[$field . ':PartialMatch'] = $this->words;
222 222
                         }
@@ -245,13 +245,13 @@  discard block
 block discarded – undo
245 245
         $back = $this->config()->get('hours_back_for_recent') ?? 24;
246 246
         $limit = $this->Config()->get('limit_per_class_for_recent') ?? 5;
247 247
         $threshold = strtotime('-' . $back . ' hours', DBDatetime::now()->getTimestamp());
248
-        if (! $threshold) {
248
+        if (!$threshold) {
249 249
             $threshold = time() - 86400;
250 250
         }
251 251
         $array = [];
252 252
         $classNames = $this->getAllDataObjects();
253 253
         foreach ($classNames as $className) {
254
-            if (! in_array($className, $this->excludedClasses, true)) {
254
+            if (!in_array($className, $this->excludedClasses, true)) {
255 255
                 $array[$className] = $className::get()
256 256
                     ->filter('LastEdited:GreaterThan', date('Y-m-d H:i:s', $threshold))
257 257
                     ->sort('LastEdited', 'DESC')
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
         if ($word) {
398 398
             $this->words[] = $word;
399 399
         }
400
-        if (! count($this->words)) {
400
+        if (!count($this->words)) {
401 401
             user_error('No word has been provided');
402 402
         }
403 403
         $this->words = array_unique($this->words);
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     protected function getAllDataObjects(): array
411 411
     {
412 412
         // if ($this->debug) {DB::alteration_message('Base Class: ' . $this->baseClass);}
413
-        if (! isset($this->cache['AllDataObjects'][$this->baseClass])) {
413
+        if (!isset($this->cache['AllDataObjects'][$this->baseClass])) {
414 414
             $this->cache['AllDataObjects'][$this->baseClass] = array_values(
415 415
                 ClassInfo::subclassesFor($this->baseClass, false)
416 416
             );
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 
423 423
     protected function getAllValidFields(string $className): array
424 424
     {
425
-        if (! isset($this->cache['AllValidFields'][$className])) {
425
+        if (!isset($this->cache['AllValidFields'][$className])) {
426 426
             $array = [];
427 427
             $fullList = Config::inst()->get($className, 'db');
428 428
             if (is_array($fullList)) {
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 
446 446
     protected function getIndexedFields(string $className, array $dbFields): array
447 447
     {
448
-        if (! isset($this->cache['IndexedFields'][$className])) {
448
+        if (!isset($this->cache['IndexedFields'][$className])) {
449 449
             $this->cache['IndexedFields'][$className] = [];
450 450
             $indexes = Config::inst()->get($className, 'indexes');
451 451
             if (is_array($indexes)) {
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 
480 480
     protected function isValidFieldType(string $className, string $fieldName, string $type): bool
481 481
     {
482
-        if (! isset($this->cache['ValidFieldTypes'][$type])) {
482
+        if (!isset($this->cache['ValidFieldTypes'][$type])) {
483 483
             $this->cache['ValidFieldTypes'][$type] = false;
484 484
             $singleton = Injector::inst()->get($className);
485 485
             $field = $singleton->dbObject($fieldName);
Please login to merge, or discard this patch.
src/Helpers/FindEditableObjects.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
 
174 174
             return (string) $dataObject->{$validMethod};
175 175
         }
176
-        if (! in_array($dataObject->ClassName, $this->excludedClasses, true)) {
176
+        if (!in_array($dataObject->ClassName, $this->excludedClasses, true)) {
177 177
             if (empty($this->cache[$type][$dataObject->ClassName]) || true !== $this->cache[$type][$dataObject->ClassName]) {
178 178
                 foreach ($validMethods as $validMethod) {
179 179
                     $outcome = null;
180 180
                     if ($dataObject->hasMethod($validMethod)) {
181 181
                         $outcome = $dataObject->{$validMethod}();
182
-                    } elseif (! empty($dataObject->{$validMethod})) {
182
+                    } elseif (!empty($dataObject->{$validMethod})) {
183 183
                         $outcome = $dataObject->{$validMethod};
184 184
                     }
185 185
                     if ($outcome) {
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             if (is_array($relType)) {
209 209
                 continue;
210 210
             }
211
-            if (! isset($this->relationTypesCovered[$relType])) {
211
+            if (!isset($this->relationTypesCovered[$relType])) {
212 212
                 $rels = $dataObject->{$relationName}();
213 213
                 if ($rels) {
214 214
                     if ($rels instanceof DataList) {
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 
235 235
     protected function getRelations($dataObject): array
236 236
     {
237
-        if (! isset($this->cache['rels'][$dataObject->ClassName])) {
237
+        if (!isset($this->cache['rels'][$dataObject->ClassName])) {
238 238
             $this->cache['rels'][$dataObject->ClassName] = array_merge(
239 239
                 Config::inst()->get($dataObject->ClassName, 'belongs_to'),
240 240
                 Config::inst()->get($dataObject->ClassName, 'has_one'),
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
                 Config::inst()->get($dataObject->ClassName, 'many_many')
244 244
             );
245 245
             foreach ($this->cache['rels'][$dataObject->ClassName] as $key => $value) {
246
-                if (! in_array($value, $this->excludedClasses, true)) {
246
+                if (!in_array($value, $this->excludedClasses, true)) {
247 247
                     unset($this->cache['rels'][$dataObject->ClassName][$key]);
248 248
                 }
249 249
             }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
     protected function getValidMethods(string $type): array
256 256
     {
257
-        if (! isset($this->cache['validMethods'][$type])) {
257
+        if (!isset($this->cache['validMethods'][$type])) {
258 258
             $this->cache['validMethods'][$type] = $this->Config()->get($type);
259 259
         }
260 260
 
Please login to merge, or discard this patch.