@@ -23,7 +23,8 @@ discard block |
||
23 | 23 | try { |
24 | 24 | $person = new midcom_db_person($this->uid); |
25 | 25 | $grp = new midcom_db_group($this->gid); |
26 | - } catch (midcom_error $e) { |
|
26 | + } |
|
27 | + catch (midcom_error $e) { |
|
27 | 28 | $e->log(); |
28 | 29 | return 'Invalid membership record'; |
29 | 30 | } |
@@ -40,7 +41,8 @@ discard block |
||
40 | 41 | } |
41 | 42 | try { |
42 | 43 | $person = new midcom_db_person($this->uid); |
43 | - } catch (midcom_error $e) { |
|
44 | + } |
|
45 | + catch (midcom_error $e) { |
|
44 | 46 | return; |
45 | 47 | } |
46 | 48 | midcom::get()->cache->invalidate($person->guid); |
@@ -88,7 +88,8 @@ |
||
88 | 88 | $style = midcom_db_style::get_cached($style_id); |
89 | 89 | $styleeditor_url = midcom_connection::get_url('self') . "__mfa/asgard/object/view/{$style->guid}/"; |
90 | 90 | $enabled = true; |
91 | - } catch (midcom_error $e) { |
|
91 | + } |
|
92 | + catch (midcom_error $e) { |
|
92 | 93 | $e->log(); |
93 | 94 | } |
94 | 95 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | $buttons = []; |
59 | 59 | $workflow = new midcom\workflow\datamanager; |
60 | - if ( $this->topic->can_do('midgard:update') |
|
60 | + if ($this->topic->can_do('midgard:update') |
|
61 | 61 | && $this->topic->can_do('midcom.admin.folder:topic_management')) { |
62 | 62 | $buttons[] = $workflow->get_button("__ais/folder/edit/", [ |
63 | 63 | MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('edit folder', 'midcom.admin.folder'), |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | ]; |
92 | 92 | } |
93 | 93 | $buttons = array_merge($buttons, $this->get_approval_controls($this->topic, false)); |
94 | - if ( $this->topic->can_do('midcom.admin.folder:template_management') |
|
94 | + if ($this->topic->can_do('midcom.admin.folder:template_management') |
|
95 | 95 | && midcom::get()->auth->can_user_do('midgard.admin.asgard:manage_objects', null, 'midgard_admin_asgard_plugin')) { |
96 | 96 | $enabled = false; |
97 | 97 | $styleeditor_url = ''; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | MIDCOM_TOOLBAR_ACCESSKEY => 'f', |
125 | 125 | ]); |
126 | 126 | } |
127 | - if ( $this->topic->guid !== midcom::get()->config->get('midcom_root_topic_guid') |
|
127 | + if ($this->topic->guid !== midcom::get()->config->get('midcom_root_topic_guid') |
|
128 | 128 | && $this->topic->can_do('midgard:delete')) { |
129 | 129 | $workflow = new midcom\workflow\delete(['object' => $this->topic, 'recursive' => true]); |
130 | 130 | $buttons[] = $workflow->get_button("__ais/folder/delete/", [ |
@@ -4,7 +4,8 @@ |
||
4 | 4 | try { |
5 | 5 | $person = new midcom_db_person($metadata->locker); |
6 | 6 | $name = $person->name; |
7 | -} catch (midcom_error $e) { |
|
7 | +} |
|
8 | +catch (midcom_error $e) { |
|
8 | 9 | $name = $this->data['handler']->_l10n_midcom->get('unknown user'); |
9 | 10 | $e->log(); |
10 | 11 | } |
@@ -63,7 +63,8 @@ |
||
63 | 63 | |
64 | 64 | try { |
65 | 65 | $attachment = new midcom_db_attachment($guid); |
66 | - } catch (midcom_error $e) { |
|
66 | + } |
|
67 | + catch (midcom_error $e) { |
|
67 | 68 | $e->log(); |
68 | 69 | return "<span class=\"missing_photo\" title=\"{$guid}\">{$fulltag}</span>{$after}"; |
69 | 70 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | return $this->render_link($parts[1], $parts[2]) . $after; |
224 | 224 | |
225 | 225 | // Macro [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>]) |
226 | - case ( preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
226 | + case (preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
227 | 227 | && method_exists($this, "_run_macro_{$macro_parts[1]}")): |
228 | 228 | $method = "_run_macro_{$macro_parts[1]}"; |
229 | 229 | return $this->$method($macro_parts[2], $match[0], $after); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $folder = $wikipage_match['latest_parent']; |
257 | 257 | } |
258 | 258 | |
259 | - if ( isset($folder[MIDCOM_NAV_OBJECT]) |
|
259 | + if (isset($folder[MIDCOM_NAV_OBJECT]) |
|
260 | 260 | && $folder[MIDCOM_NAV_OBJECT]->can_do('midgard:create')) { |
261 | 261 | $workflow = $this->get_workflow('datamanager'); |
262 | 262 | return "<a href=\"{$folder[MIDCOM_NAV_ABSOLUTEURL]}create/?wikiword={$wikipage_match['remaining_path']}\" " . $workflow->render_attributes() . " class=\"wiki_missing\" title=\"" . $this->_l10n->get('click to create') . "\">{$text}</a>"; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $links[$parts[1]] = $parts[2]; |
292 | 292 | } |
293 | 293 | // Ignore macros [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>]) |
294 | - elseif ( !preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
294 | + elseif (!preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
295 | 295 | || !method_exists($this, "_run_macro_{$macro_parts[1]}")) { |
296 | 296 | // MediaWiki-style link [wikipage] (no text) |
297 | 297 | $links[$fulltext] = $fulltext; |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $qb->add_constraint('name', '<>', ''); |
47 | 47 | |
48 | 48 | // Unless in Auto-Index mode or the index article is hidden, we skip the index article. |
49 | - if ( !$this->_config->get('autoindex') |
|
49 | + if (!$this->_config->get('autoindex') |
|
50 | 50 | && !$this->_config->get('indexinnav')) { |
51 | 51 | $qb->add_constraint('name', '<>', 'index'); |
52 | 52 | } |
@@ -99,7 +99,7 @@ |
||
99 | 99 | $qb = midcom::get()->dbfactory->new_query_builder($this->config['type_config']['mapping_class_name']); |
100 | 100 | $qb->add_constraint($this->config['type_config']['master_fieldname'], '=', $this->get_master_foreign_key()); |
101 | 101 | |
102 | - if ( $this->config['type_config']['sortable'] |
|
102 | + if ($this->config['type_config']['sortable'] |
|
103 | 103 | && preg_match('/^(ASC|DESC)/i', $this->config['type_config']['sortable_sort_order'], $regs)) { |
104 | 104 | $order = strtoupper($regs[1]); |
105 | 105 | $qb->add_order('metadata.score', $order); |
@@ -120,14 +120,16 @@ |
||
120 | 120 | if (!empty($this->customer)) { |
121 | 121 | try { |
122 | 122 | return org_openpsa_contacts_group_dba::get_cached($this->customer); |
123 | - } catch (midcom_error $e) { |
|
123 | + } |
|
124 | + catch (midcom_error $e) { |
|
124 | 125 | $e->log(); |
125 | 126 | } |
126 | 127 | } |
127 | 128 | if (!empty($this->customerContact)) { |
128 | 129 | try { |
129 | 130 | return org_openpsa_contacts_person_dba::get_cached($this->customerContact); |
130 | - } catch (midcom_error $e) { |
|
131 | + } |
|
132 | + catch (midcom_error $e) { |
|
131 | 133 | $e->log(); |
132 | 134 | } |
133 | 135 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | } |
121 | 121 | $profit = $value - $cost; |
122 | - if ( $this->value != $value |
|
122 | + if ($this->value != $value |
|
123 | 123 | || $this->profit != $profit) { |
124 | 124 | $this->value = $value; |
125 | 125 | $this->profit = $value - $cost; |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | |
185 | 185 | public function _on_updating() : bool |
186 | 186 | { |
187 | - if ( $this->state != self::STATE_ACTIVE |
|
187 | + if ($this->state != self::STATE_ACTIVE |
|
188 | 188 | && !$this->end) { |
189 | 189 | //Not active anymore and end not set, set it to now |
190 | 190 | $this->end = time(); |
191 | 191 | } |
192 | - if ( $this->end |
|
192 | + if ($this->end |
|
193 | 193 | && $this->state == self::STATE_ACTIVE) { |
194 | 194 | //Returned to active state, clear the end marker. |
195 | 195 | $this->end = 0; |
@@ -68,7 +68,7 @@ |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | $config = $this->get_config_for_topic($topic); |
71 | - if ( $object->name == 'index' |
|
71 | + if ($object->name == 'index' |
|
72 | 72 | && !$config->get('autoindex')) { |
73 | 73 | return ''; |
74 | 74 | } |
@@ -29,7 +29,8 @@ |
||
29 | 29 | foreach ($qb->execute() as $article) { |
30 | 30 | try { |
31 | 31 | $datamanager->set_storage($article); |
32 | - } catch (midcom_error $e) { |
|
32 | + } |
|
33 | + catch (midcom_error $e) { |
|
33 | 34 | $e->log(MIDCOM_LOG_WARN); |
34 | 35 | continue; |
35 | 36 | } |
@@ -152,7 +152,8 @@ |
||
152 | 152 | try { |
153 | 153 | $topic = new midcom_db_topic($id); |
154 | 154 | $id = $topic->id; |
155 | - } catch (midcom_error $e) { |
|
155 | + } |
|
156 | + catch (midcom_error $e) { |
|
156 | 157 | $e->log(); |
157 | 158 | break; |
158 | 159 | } |
@@ -19,8 +19,8 @@ |
||
19 | 19 | public function _on_initialize() |
20 | 20 | { |
21 | 21 | // Match / |
22 | - if ( $this->_config->get('redirection_type') === null |
|
23 | - || ( $this->_topic->can_do('net.nemein.redirector:noredirect') |
|
22 | + if ($this->_config->get('redirection_type') === null |
|
23 | + || ($this->_topic->can_do('net.nemein.redirector:noredirect') |
|
24 | 24 | && !$this->_config->get('admin_redirection'))) { |
25 | 25 | $this->_request_switch['redirect'] = [ |
26 | 26 | 'handler' => [net_nemein_redirector_handler_tinyurl::class, 'list'], |