Passed
Branch master (7a7694)
by Andreas
18:25
created
lib/midcom/helper/metadata.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -658,7 +658,8 @@
 block discarded – undo
658 658
             && mgd_is_guid($guid)) {
659 659
             try {
660 660
                 $object = midcom::get()->dbfactory->get_object_by_guid($guid);
661
-            } catch (midcom_error $e) {
661
+            }
662
+            catch (midcom_error $e) {
662 663
                 debug_add("Failed to create a metadata instance for the GUID {$guid}: " . $e->getMessage(), MIDCOM_LOG_WARN);
663 664
                 debug_print_r("Source was:", $source);
664 665
 
Please login to merge, or discard this 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.
lib/midcom/admin/folder/handler/order.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,8 @@
 block discarded – undo
69 69
         // Use the DB Factory to resolve the class and to get the object
70 70
         try {
71 71
             $object = midcom::get()->dbfactory->get_object_by_guid($identifier);
72
-        } catch (midcom_error $e) {
72
+        }
73
+        catch (midcom_error $e) {
73 74
             // This is probably a pseudo leaf, store the score to the current node
74 75
             $this->_topic->set_parameter('midcom.helper.nav.score', $identifier, $score);
75 76
             return true;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
         }
90 90
 
91 91
         // Approve if possible
92
-        if (   $approval_status
92
+        if ($approval_status
93 93
             && $object->can_do('midcom:approve')) {
94 94
             $object->metadata->approve();
95 95
         }
Please login to merge, or discard this patch.
lib/midcom/services/cache/module/nap.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,8 @@
 block discarded – undo
132 132
                       && $nodeobject = $nav->get_node($node->id)) {
133 133
                 $napobject = $nav->get_leaf($nodeobject[MIDCOM_NAV_ID] . '-' . $object->id);
134 134
             }
135
-        } catch (midcom_error $e) {
135
+        }
136
+        catch (midcom_error $e) {
136 137
             $e->log();
137 138
         }
138 139
         return $napobject;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             // Get parent from DB and compare to catch moves
72 72
             if ($parent = $napobject[MIDCOM_NAV_OBJECT]->get_parent()) {
73 73
                 $parent_entry = $this->get_guid($parent->guid);
74
-                if (   $parent_entry
74
+                if ($parent_entry
75 75
                     && $parent_entry[MIDCOM_NAV_ID] != $cached_node_id) {
76 76
                     $this->backend->delete($parent_entry[MIDCOM_NAV_ID] . '-leaves');
77 77
                 }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             $parent_id = $napobject[MIDCOM_NAV_NODEID];
87 87
             $parent_entry = $this->get_node($parent_id);
88 88
 
89
-            if (   $parent_entry
89
+            if ($parent_entry
90 90
                 && array_key_exists(MIDCOM_NAV_SUBNODES, $parent_entry)) {
91 91
                 unset($parent_entry[MIDCOM_NAV_SUBNODES]);
92 92
                 $this->put_node($parent_id, $parent_entry);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             if ($parent = $napobject[MIDCOM_NAV_OBJECT]->get_parent()) {
97 97
                 $parent_entry_from_object = $this->get_guid($parent->guid);
98 98
 
99
-                if (    !empty($parent_entry_from_object[MIDCOM_NAV_ID])
99
+                if (!empty($parent_entry_from_object[MIDCOM_NAV_ID])
100 100
                      && !empty($parent_entry[MIDCOM_NAV_ID])
101 101
                      && $parent_entry_from_object[MIDCOM_NAV_ID] != $parent_entry[MIDCOM_NAV_ID]) {
102 102
                     unset($parent_entry_from_object[MIDCOM_NAV_SUBNODES]);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             $nav = new midcom_helper_nav;
123 123
             if ($object instanceof midcom_db_topic) {
124 124
                 $napobject = $nav->get_node($object->id);
125
-            } elseif (   ($node = $nav->find_closest_topic($object))
125
+            } elseif (($node = $nav->find_closest_topic($object))
126 126
                       && $nodeobject = $nav->get_node($node->id)) {
127 127
                 $napobject = $nav->get_leaf($nodeobject[MIDCOM_NAV_ID] . '-' . $object->id);
128 128
             }
Please login to merge, or discard this patch.
lib/midcom/services/permalinks/main.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,8 @@
 block discarded – undo
72 72
 
73 73
         try {
74 74
             $object = midcom::get()->dbfactory->get_object_by_guid($guid);
75
-        } catch (midcom_error $e) {
75
+        }
76
+        catch (midcom_error $e) {
76 77
             debug_add("Failed to resolve the GUID {$guid}, this is most probably an access denied error.", MIDCOM_LOG_ERROR);
77 78
             debug_add('Last MidCOM error string: ' . $e->getMessage());
78 79
             return null;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
         if ($object instanceof midcom_db_attachment) {
94 94
             // Faster linking to attachments
95 95
             $parent = $object->get_parent();
96
-            if (   is_a($parent, midcom_db_topic::class)
96
+            if (is_a($parent, midcom_db_topic::class)
97 97
                 && $nav->is_node_in_tree($parent->id, $nav->get_root_node())) {
98 98
                 $napobj = $nav->get_node($parent->id);
99 99
                 return $napobj[MIDCOM_NAV_FULLURL] . $object->name;
Please login to merge, or discard this patch.
lib/midcom/services/indexer/document/midcom.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
      */
110 110
     public function members_to_fields()
111 111
     {
112
-        if (   empty($this->topic_guid)
112
+        if (empty($this->topic_guid)
113 113
             || empty($this->topic_url)
114 114
             || empty($this->component)) {
115 115
             //if one of those is missing, we override all three to ensure consistency
Please login to merge, or discard this patch.
lib/midcom/config/test.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@
 block discarded – undo
104 104
             $this->add('Setting: upload_max_filesize', self::OK, ini_get('upload_max_filesize'));
105 105
         } else {
106 106
             $this->add('Setting: upload_max_filesize',
107
-                             self::WARNING, "To make bulk uploads (for exampe in the Image Gallery) useful, you should increase the Upload limit to something above 50 MB. (Current setting: {$upload_limit})");
107
+                                self::WARNING, "To make bulk uploads (for exampe in the Image Gallery) useful, you should increase the Upload limit to something above 50 MB. (Current setting: {$upload_limit})");
108 108
         }
109 109
 
110 110
         $post_limit = $this->ini_get_filesize('post_max_size');
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,8 @@
 block discarded – undo
81 81
                 $class = $config->get_backend_class();
82 82
                 new $class(new midcom_db_topic, $config);
83 83
                 $this->add("MidCOM RCS", self::OK, $class);
84
-            } catch (midcom_error $e) {
84
+            }
85
+            catch (midcom_error $e) {
85 86
                 $this->add("MidCOM RCS", self::ERROR, $e->getMessage());
86 87
             }
87 88
         } else {
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/toolbar.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,8 @@
 block discarded – undo
117 117
                                 }
118 118
                                 break;
119 119
                         }
120
-                    } catch (midcom_error $e) {
120
+                    }
121
+                    catch (midcom_error $e) {
121 122
                         $e->log();
122 123
                     }
123 124
                 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
             ];
148 148
         }
149 149
 
150
-        if (   midcom::get()->config->get('midcom_services_rcs_enable')
150
+        if (midcom::get()->config->get('midcom_services_rcs_enable')
151 151
             && $object->can_do('midgard:update')
152 152
             && $object->_use_rcs) {
153 153
             $buttons[] = [
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
     private function get_toolbar_update_items($object) : array
209 209
     {
210 210
         $buttons = [];
211
-        if (   is_a($object, midcom_db_topic::class)
211
+        if (is_a($object, midcom_db_topic::class)
212 212
             && $object->component
213 213
             && $object->can_do('midcom:component_config')) {
214 214
             $buttons[] = [
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
             MIDCOM_TOOLBAR_ENABLED => $object->can_do('midgard:privileges'),
247 247
         ];
248 248
 
249
-        if (   midcom::get()->componentloader->is_installed('midcom.helper.replicator')
249
+        if (midcom::get()->componentloader->is_installed('midcom.helper.replicator')
250 250
             && midcom::get()->auth->admin) {
251 251
             $buttons[] = [
252 252
                 MIDCOM_TOOLBAR_URL => "__mfa/asgard_midcom.helper.replicator/object/{$object->guid}/",
Please login to merge, or discard this patch.
lib/midgard/admin/user/handler/list.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,7 +217,8 @@
 block discarded – undo
217 217
 
218 218
         try {
219 219
             $account = new midcom_core_account($person);
220
-        } catch (midcom_error $e) {
220
+        }
221
+        catch (midcom_error $e) {
221 222
             midcom::get()->uimessages->add($this->_l10n->get('midgard.admin.user'), sprintf($this->_l10n->get('failed to get the user with id %s'), $person->id), 'error');
222 223
             return;
223 224
         }
Please login to merge, or discard this patch.
lib/org/openpsa/mypage/handler/workingon.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,8 @@
 block discarded – undo
92 92
                         $customer = new org_openpsa_contacts_group_dba($customer_id);
93 93
                         $customer_label = $customer->official;
94 94
                         $customer = $customer_id;
95
-                    } catch (midcom_error $e) {
95
+                    }
96
+                    catch (midcom_error $e) {
96 97
                     }
97 98
                 }
98 99
             }
Please login to merge, or discard this patch.