@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ]); |
55 | 55 | } |
56 | 56 | |
57 | - if ( midcom::get()->config->get('midcom_services_rcs_enable') |
|
57 | + if (midcom::get()->config->get('midcom_services_rcs_enable') |
|
58 | 58 | && $object->can_do('midgard:update') |
59 | 59 | && $object->_use_rcs) { |
60 | 60 | $buttons[] = [ |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | $icon = 'stock-icons/16x16/page-' . $icontype . '.png'; |
87 | - if ( !midcom::get()->config->get('show_hidden_objects') |
|
87 | + if (!midcom::get()->config->get('show_hidden_objects') |
|
88 | 88 | && !$object->metadata->is_visible()) { |
89 | 89 | // Take scheduling into account |
90 | 90 | $icon = 'stock-icons/16x16/page-' . $icontype . '-notpublished.png'; |
@@ -123,7 +123,8 @@ |
||
123 | 123 | $row = []; |
124 | 124 | try { |
125 | 125 | $row['person'] = org_openpsa_contacts_person_dba::get_cached($hour->person); |
126 | - } catch (midcom_error $e) { |
|
126 | + } |
|
127 | + catch (midcom_error $e) { |
|
127 | 128 | $e->log(); |
128 | 129 | continue; |
129 | 130 | } |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | $qb_hr = org_openpsa_expenses_hour_report_dba::new_query_builder(); |
48 | 48 | $qb_hr->add_constraint('date', '<=', (int) $query_data['end']); |
49 | 49 | $qb_hr->add_constraint('date', '>=', (int) $query_data['start']); |
50 | - if ( array_key_exists('invoiceable_filter', $query_data) |
|
50 | + if (array_key_exists('invoiceable_filter', $query_data) |
|
51 | 51 | && $query_data['invoiceable_filter'] != -1) { |
52 | 52 | $qb_hr->add_constraint('invoiceable', '=', (bool) $query_data['invoiceable_filter']); |
53 | 53 | } |
54 | 54 | |
55 | - if ( array_key_exists('invoiced_filter', $query_data) |
|
55 | + if (array_key_exists('invoiced_filter', $query_data) |
|
56 | 56 | && $query_data['invoiced_filter'] != -1) { |
57 | 57 | if ((int) $query_data['invoiced_filter']) { |
58 | 58 | debug_add('invoiced_filter parsed as ONLY, adding constraint'); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $tasks = $this->_expand_task($query_data['task']); |
72 | 72 | $qb_hr->add_constraint('task', 'IN', $tasks); |
73 | 73 | } |
74 | - if ( array_key_exists('hour_type_filter', $query_data) |
|
74 | + if (array_key_exists('hour_type_filter', $query_data) |
|
75 | 75 | && $query_data['hour_type_filter'] != 'builtin:all') { |
76 | 76 | $qb_hr->add_constraint('reportType', '=', $query_data['hour_type_filter']); |
77 | 77 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | private function add_to_group(array $new_row, string $matching, string $sort, string $title) |
142 | 142 | { |
143 | - $rows =& $this->_request_data['report']['rows']; |
|
143 | + $rows = & $this->_request_data['report']['rows']; |
|
144 | 144 | if (array_key_exists($matching, $rows)) { |
145 | 145 | $rows[$matching]['rows'][] = $new_row; |
146 | 146 | $rows[$matching]['total_hours'] += $new_row['hour']->hours; |
@@ -222,7 +222,8 @@ discard block |
||
222 | 222 | $this->_backend->send($person, $member, $token, $subject, $content, $from); |
223 | 223 | self::$_messages_sent++; |
224 | 224 | $status = org_openpsa_directmarketing_campaign_messagereceipt_dba::SENT; |
225 | - } catch (midcom_error $e) { |
|
225 | + } |
|
226 | + catch (midcom_error $e) { |
|
226 | 227 | $status = org_openpsa_directmarketing_campaign_messagereceipt_dba::FAILURE; |
227 | 228 | if (!$this->test_mode) { |
228 | 229 | $params[] = [ |
@@ -279,7 +280,8 @@ discard block |
||
279 | 280 | { |
280 | 281 | try { |
281 | 282 | $person = org_openpsa_contacts_person_dba::get_cached($member->person); |
282 | - } catch (midcom_error $e) { |
|
283 | + } |
|
284 | + catch (midcom_error $e) { |
|
283 | 285 | debug_add("Person #{$member->person} deleted or missing, removing member (member #{$member->id})"); |
284 | 286 | $member->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED; |
285 | 287 | $member->delete(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $this->from = $from; |
76 | 76 | $this->subject = $subject; |
77 | 77 | |
78 | - if ( $message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_TEXT |
|
78 | + if ($message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_TEXT |
|
79 | 79 | && $message->orgOpenpsaObtype != org_openpsa_directmarketing_campaign_message_dba::EMAIL_HTML) { |
80 | 80 | throw new midcom_error('unsupported message type'); |
81 | 81 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $token .= midcom_helper_misc::random_string($this->token_size - 1, 'abcdefghijklmnopqrstuvwxyz0123456789'); |
220 | 220 | |
221 | 221 | //If token is not free or (very, very unlikely) matches our dummy token, recurse. |
222 | - if ( $token === 'dummy' |
|
222 | + if ($token === 'dummy' |
|
223 | 223 | || !org_openpsa_directmarketing_campaign_messagereceipt_dba::token_is_free($token)) { |
224 | 224 | return $this->_create_token(); |
225 | 225 | } |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | return null; |
241 | 241 | } |
242 | 242 | $type = $this->_backend->get_type(); |
243 | - if ( $person->get_parameter('org.openpsa.directmarketing', "send_all_denied") |
|
243 | + if ($person->get_parameter('org.openpsa.directmarketing', "send_all_denied") |
|
244 | 244 | || $person->get_parameter('org.openpsa.directmarketing', "send_{$type}_denied")) { |
245 | 245 | debug_add("Sending {$type} messages to person {$person->rname} is denied, unsubscribing member (member #{$member->id})"); |
246 | 246 | $member->orgOpenpsaObtype = org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED; |
@@ -210,8 +210,7 @@ |
||
210 | 210 | { |
211 | 211 | $ret = []; |
212 | 212 | |
213 | - foreach ($this->storage as $field => $value) |
|
214 | - { |
|
213 | + foreach ($this->storage as $field => $value) { |
|
215 | 214 | $ret[$field] = $value->get_value(); |
216 | 215 | $config = $this->schema->get_field($field); |
217 | 216 | if (!empty($config['type_config']['allow_multiple'])) { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | public function set_storage(midcom_core_dbaobject $storage = null, string $schemaname = null) : self |
59 | 59 | { |
60 | - if ( $schemaname === null |
|
60 | + if ($schemaname === null |
|
61 | 61 | && !empty($storage->id)) { |
62 | 62 | $schemaname = $storage->get_parameter('midcom.helper.datamanager2', 'schema_name'); |
63 | 63 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $this->form = null; |
148 | 148 | } |
149 | 149 | |
150 | - if ( $this->form === null |
|
150 | + if ($this->form === null |
|
151 | 151 | || ($name && $this->form->getName() != $name)) { |
152 | 152 | $this->build_form($this->get_builder($name)); |
153 | 153 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | { |
236 | 236 | $ret = true; |
237 | 237 | foreach ($this->storage as $field) { |
238 | - if ( $field instanceof recreateable |
|
238 | + if ($field instanceof recreateable |
|
239 | 239 | && !$field->recreate()) { |
240 | 240 | $ret = false; |
241 | 241 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | |
73 | 73 | $this->_group = new org_openpsa_contacts_group_dba(); |
74 | 74 | |
75 | - if ( $this->_type == 'organization' |
|
75 | + if ($this->_type == 'organization' |
|
76 | 76 | && $this->_parent_group) { |
77 | 77 | $this->_group->owner = $this->_parent_group->id; |
78 | 78 | } else { |
@@ -50,6 +50,6 @@ |
||
50 | 50 | $indexer = new org_openpsa_documents_midcom_indexer($this->_topic); |
51 | 51 | $indexer->index($controller->get_datamanager()); |
52 | 52 | |
53 | - return $controller->get_datamanager()->get_storage()->get_value()->name. "/"; |
|
53 | + return $controller->get_datamanager()->get_storage()->get_value()->name . "/"; |
|
54 | 54 | } |
55 | 55 | } |
@@ -30,7 +30,8 @@ |
||
30 | 30 | $this->config = $config; |
31 | 31 | } |
32 | 32 | |
33 | - protected function cast($value) { |
|
33 | + protected function cast($value) |
|
34 | + { |
|
34 | 35 | if ($this->config['type'] == 'number' && !is_numeric($value)) { |
35 | 36 | $value = (float) $value; |
36 | 37 | } |
@@ -30,7 +30,8 @@ |
||
30 | 30 | foreach ($result as $wikipage) { |
31 | 31 | try { |
32 | 32 | $datamanager->set_storage($wikipage); |
33 | - } catch (midcom_error $e) { |
|
33 | + } |
|
34 | + catch (midcom_error $e) { |
|
34 | 35 | $e->log(MIDCOM_LOG_WARN); |
35 | 36 | continue; |
36 | 37 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) : ?string |
46 | 46 | { |
47 | - if ( $object instanceof midcom_db_article |
|
47 | + if ($object instanceof midcom_db_article |
|
48 | 48 | && $topic->id == $object->topic) { |
49 | 49 | if ($object->name == 'index') { |
50 | 50 | return ''; |
@@ -409,7 +409,8 @@ |
||
409 | 409 | foreach ($this->_articles as $article_counter => $article) { |
410 | 410 | try { |
411 | 411 | $data['datamanager']->set_storage($article); |
412 | - } catch (midcom_error $e) { |
|
412 | + } |
|
413 | + catch (midcom_error $e) { |
|
413 | 414 | $e->log(); |
414 | 415 | continue; |
415 | 416 | } |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $year_data = []; |
132 | 132 | $first_post = $this->_compute_welcome_first_post(); |
133 | 133 | $this->_request_data['first_post'] = $first_post; |
134 | - $this->_request_data['total_count'] =& $total_count; |
|
135 | - $this->_request_data['year_data'] =& $year_data; |
|
134 | + $this->_request_data['total_count'] = & $total_count; |
|
135 | + $this->_request_data['year_data'] = & $year_data; |
|
136 | 136 | if (!$first_post) { |
137 | 137 | return; |
138 | 138 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | switch ($handler_id) { |
262 | 262 | case 'archive-year-category': |
263 | 263 | $category = trim(strip_tags($args[1])); |
264 | - if ( $data['datamanager']->get_schema('default')->has_field('categories') |
|
264 | + if ($data['datamanager']->get_schema('default')->has_field('categories') |
|
265 | 265 | && !$data['datamanager']->get_schema('default')->get_field('categories')['type_config']['allow_multiple']) { |
266 | 266 | $qb->add_constraint('extra1', '=', $category); |
267 | 267 | } else { |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | throw new midcom_error_notfound("The year '{$year}' is not valid."); |
346 | 346 | } |
347 | 347 | |
348 | - if ( $month < 1 |
|
348 | + if ($month < 1 |
|
349 | 349 | || $month > 12) { |
350 | 350 | throw new midcom_error_notfound("The month {$month} is not valid."); |
351 | 351 | } |