@@ -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 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | return $this->render_link($parts[1], $parts[2]) . $after; |
| 220 | 220 | |
| 221 | 221 | // Macro [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>]) |
| 222 | - case ( preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
| 222 | + case (preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
| 223 | 223 | && method_exists($this, "_run_macro_{$macro_parts[1]}")): |
| 224 | 224 | $method = "_run_macro_{$macro_parts[1]}"; |
| 225 | 225 | return $this->$method($macro_parts[2], $match[0], $after); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | // No page matched, link to creation |
| 248 | 248 | $folder = $wikipage_match['folder'] ?? $wikipage_match['latest_parent']; |
| 249 | 249 | |
| 250 | - if ( isset($folder[MIDCOM_NAV_OBJECT]) |
|
| 250 | + if (isset($folder[MIDCOM_NAV_OBJECT]) |
|
| 251 | 251 | && $folder[MIDCOM_NAV_OBJECT]->can_do('midgard:create')) { |
| 252 | 252 | $workflow = $this->get_workflow('datamanager'); |
| 253 | 253 | 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>"; |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $links[$parts[1]] = $parts[2]; |
| 283 | 283 | } |
| 284 | 284 | // Ignore macros [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>]) |
| 285 | - elseif ( !preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
| 285 | + elseif (!preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
| 286 | 286 | || !method_exists($this, "_run_macro_{$macro_parts[1]}")) { |
| 287 | 287 | // MediaWiki-style link [wikipage] (no text) |
| 288 | 288 | $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'], |
@@ -66,7 +66,8 @@ |
||
| 66 | 66 | try { |
| 67 | 67 | $author = new midcom_db_person($wikipage->metadata->revisor); |
| 68 | 68 | $item->author = $author->name; |
| 69 | - } catch (midcom_error $e) { |
|
| 69 | + } |
|
| 70 | + catch (midcom_error $e) { |
|
| 70 | 71 | $e->log(); |
| 71 | 72 | } |
| 72 | 73 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if ( $history['date'] < $from |
|
| 53 | + if ($history['date'] < $from |
|
| 54 | 54 | || $history['date'] > $to) { |
| 55 | 55 | // We can ignore revisions outside the timeframe |
| 56 | 56 | continue; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $this->_seek_updated($from); |
| 94 | 94 | |
| 95 | 95 | $i = 0; |
| 96 | - while ( $this->_updated_pages < $this->_max_pages |
|
| 96 | + while ($this->_updated_pages < $this->_max_pages |
|
| 97 | 97 | && $i < 20) { |
| 98 | 98 | // Expand seek by another two weeks |
| 99 | 99 | $to = $from; |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | public function get_link($key = 0, $rel = 'alternate') |
| 62 | 62 | { |
| 63 | 63 | $link = parent::get_link($key, $rel); |
| 64 | - if ( $rel !== 'alternate' |
|
| 64 | + if ($rel !== 'alternate' |
|
| 65 | 65 | || $key !== 0) { |
| 66 | 66 | return $link; |
| 67 | 67 | } |