Completed
Push — master ( 527212...df338f )
by Andreas
39:48
created
lib/midcom/helper/metadata.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     {
293 293
         if (in_array($key, $this->field_config['timebased'])) {
294 294
             // This is ugly, but seems the only possible way...
295
-            if (   isset($this->__metadata->$key)
295
+            if (isset($this->__metadata->$key)
296 296
                 && (string) $this->__metadata->$key !== "0001-01-01T00:00:00+00:00") {
297 297
                 return (int) $this->__metadata->$key->format('U');
298 298
             }
@@ -354,11 +354,11 @@  discard block
 block discarded – undo
354 354
         }
355 355
 
356 356
         $now = time();
357
-        if (   $this->get('schedulestart')
357
+        if ($this->get('schedulestart')
358 358
             && $this->get('schedulestart') > $now) {
359 359
             return false;
360 360
         }
361
-        if (   $this->get('scheduleend')
361
+        if ($this->get('scheduleend')
362 362
             && $this->get('scheduleend') < $now) {
363 363
             return false;
364 364
         }
@@ -374,9 +374,9 @@  discard block
 block discarded – undo
374 374
     public function is_object_visible_onsite() : bool
375 375
     {
376 376
         return
377
-        (   (   midcom::get()->config->get('show_hidden_objects')
377
+        ((midcom::get()->config->get('show_hidden_objects')
378 378
              || $this->is_visible())
379
-         && (   midcom::get()->config->get('show_unapproved_objects')
379
+         && (midcom::get()->config->get('show_unapproved_objects')
380 380
              || $this->is_approved())
381 381
         );
382 382
     }
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
             $guid = $source;
435 435
         }
436 436
 
437
-        if (   $object === null
437
+        if ($object === null
438 438
             && mgd_is_guid($guid)) {
439 439
             try {
440 440
                 $object = midcom::get()->dbfactory->get_object_by_guid($guid);
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
         }
468 468
 
469 469
         // Lock was created by the user, return "not locked"
470
-        if (   !empty(midcom::get()->auth->user->guid)
470
+        if (!empty(midcom::get()->auth->user->guid)
471 471
             && $this->get('locker') === midcom::get()->auth->user->guid) {
472 472
             return false;
473 473
         }
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
      */
501 501
     public function can_unlock() : bool
502 502
     {
503
-        return (   $this->__object->can_do('midcom:unlock')
503
+        return ($this->__object->can_do('midcom:unlock')
504 504
                 || midcom::get()->auth->can_user_do('midcom:unlock', null, midcom_services_auth::class));
505 505
     }
506 506
 
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
      */
512 512
     public function unlock() : bool
513 513
     {
514
-        if (   $this->can_unlock()
514
+        if ($this->can_unlock()
515 515
             && $this->__object->unlock()) {
516 516
             $this->_cache = [];
517 517
             return true;
Please login to merge, or discard this patch.