Completed
Pull Request — master (#198)
by
unknown
19:02
created
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/db/topic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     public function _on_loaded()
31 31
     {
32 32
         // if we are missing the component, use the nullcomponent.
33
-        if (   !$this->component
33
+        if (!$this->component
34 34
             || !array_key_exists($this->component, midcom::get()->componentloader->manifests)) {
35 35
             debug_add("Topic {$this->id} has no component assigned to it, using 'midcom.core.nullcomponent'.",
36 36
             MIDCOM_LOG_INFO);
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   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             // Get parent from DB and compare to catch moves
78 78
             if ($parent = $napobject[MIDCOM_NAV_OBJECT]->get_parent()) {
79 79
                 $parent_entry_from_object = $this->get_guid($parent->guid);
80
-                if (    $parent_entry_from_object
80
+                if ($parent_entry_from_object
81 81
                      && $parent_entry_from_object[MIDCOM_NAV_ID] != $cached_node_id) {
82 82
                     $this->_cache->delete($this->_prefix . '-' . $parent_entry_from_object[MIDCOM_NAV_ID] . '-leaves');
83 83
                 }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             $parent_id = $napobject[MIDCOM_NAV_NODEID];
93 93
             $parent_entry = $this->get_node($parent_id);
94 94
 
95
-            if (   $parent_entry
95
+            if ($parent_entry
96 96
                 && array_key_exists(MIDCOM_NAV_SUBNODES, $parent_entry)) {
97 97
                 unset($parent_entry[MIDCOM_NAV_SUBNODES]);
98 98
                 $this->put_node($parent_id, $parent_entry);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             if ($parent = $napobject[MIDCOM_NAV_OBJECT]->get_parent()) {
103 103
                 $parent_entry_from_object = $this->get_guid($parent->guid);
104 104
 
105
-                if (    !empty($parent_entry_from_object[MIDCOM_NAV_ID])
105
+                if (!empty($parent_entry_from_object[MIDCOM_NAV_ID])
106 106
                      && !empty($parent_entry[MIDCOM_NAV_ID])
107 107
                      && $parent_entry_from_object[MIDCOM_NAV_ID] != $parent_entry[MIDCOM_NAV_ID]) {
108 108
                     unset($parent_entry_from_object[MIDCOM_NAV_SUBNODES]);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             $nav = new midcom_helper_nav;
129 129
             if ($object instanceof midcom_db_topic) {
130 130
                 $napobject = $nav->get_node($object->id);
131
-            } elseif (   ($node = $nav->find_closest_topic($object))
131
+            } elseif (($node = $nav->find_closest_topic($object))
132 132
                       && $nodeobject = $nav->get_node($node->id)) {
133 133
                 $napobject = $nav->get_leaf($nodeobject[MIDCOM_NAV_ID] . '-' . $object->id);
134 134
             }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         }
154 154
         $lang_id = midcom::get()->i18n->get_current_language();
155 155
         $result = $this->_cache->fetch("{$this->_prefix}-{$key}");
156
-        if (   !is_array($result)
156
+        if (!is_array($result)
157 157
             || !isset($result[$lang_id])) {
158 158
             return false;
159 159
         }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
         $lang_id = midcom::get()->i18n->get_current_language();
179 179
         $result = $this->_cache->fetch("{$this->_prefix}-{$key}");
180
-        if (   !is_array($result)
180
+        if (!is_array($result)
181 181
             || !isset($result[$lang_id])) {
182 182
             return false;
183 183
         }
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
         $lang_id = midcom::get()->i18n->get_current_language();
246 246
         $result = $this->_cache->fetch("{$this->_prefix}-{$guid}");
247
-        if (   !is_array($result)
247
+        if (!is_array($result)
248 248
             || !isset($result[$lang_id])) {
249 249
             return false;
250 250
         }
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
@@ -74,7 +74,8 @@
 block discarded – undo
74 74
                 $config = new midcom_services_rcs_config($config);
75 75
                 $config->test_rcs_config();
76 76
                 $this->add("MidCOM RCS", self::OK);
77
-            } catch (midcom_error $e) {
77
+            }
78
+            catch (midcom_error $e) {
78 79
                 $this->add("MidCOM RCS", self::ERROR, $e->getMessage());
79 80
             }
80 81
         } else {
Please login to merge, or discard this patch.
lib/midcom/core/context.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -181,7 +181,8 @@
 block discarded – undo
181 181
         } else {
182 182
             try {
183 183
                 $root_node = midcom_db_topic::get_cached($guid);
184
-            } catch (midcom_error $e) {
184
+            }
185
+            catch (midcom_error $e) {
185 186
                 if ($e instanceof midcom_error_forbidden) {
186 187
                     throw $e;
187 188
                 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             return false;
149 149
         }
150 150
 
151
-        if (   $key === MIDCOM_CONTEXT_ROOTTOPIC
151
+        if ($key === MIDCOM_CONTEXT_ROOTTOPIC
152 152
             && $this->_data[$key] === null) {
153 153
             $this->_initialize_root_topic();
154 154
         }
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
      */
275 275
     public function set_custom_key($key, &$value)
276 276
     {
277
-        $this->_data[MIDCOM_CONTEXT_CUSTOMDATA][$key] =& $value;
277
+        $this->_data[MIDCOM_CONTEXT_CUSTOMDATA][$key] = & $value;
278 278
     }
279 279
 
280 280
     public function show()
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
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             ];
145 145
         }
146 146
 
147
-        if (   midcom::get()->config->get('midcom_services_rcs_enable')
147
+        if (midcom::get()->config->get('midcom_services_rcs_enable')
148 148
             && $object->can_do('midgard:update')
149 149
             && $object->_use_rcs) {
150 150
             $buttons[] = [
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
     private function get_toolbar_update_items($object)
206 206
     {
207 207
         $buttons = [];
208
-        if (   is_a($object, midcom_db_topic::class)
208
+        if (is_a($object, midcom_db_topic::class)
209 209
             && $object->component
210 210
             && $object->can_do('midcom:component_config')) {
211 211
             $buttons[] = [
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
             MIDCOM_TOOLBAR_ENABLED => $object->can_do('midgard:privileges'),
244 244
         ];
245 245
 
246
-        if (   midcom::get()->componentloader->is_installed('midcom.helper.replicator')
246
+        if (midcom::get()->componentloader->is_installed('midcom.helper.replicator')
247 247
             && midcom::get()->auth->admin) {
248 248
             $buttons[] = [
249 249
                 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.