@@ -37,7 +37,8 @@ |
||
37 | 37 | foreach ($items as $identifier => $guid) { |
38 | 38 | try { |
39 | 39 | $results[$identifier] = new midcom_db_attachment($guid); |
40 | - } catch (midcom_error $e) { |
|
40 | + } |
|
41 | + catch (midcom_error $e) { |
|
41 | 42 | $e->log(); |
42 | 43 | } |
43 | 44 | } |
@@ -143,7 +143,7 @@ |
||
143 | 143 | protected function save_attachment_list() |
144 | 144 | { |
145 | 145 | if (!empty($this->config['widget_config']['sortable'])) { |
146 | - uasort($this->map, function ($a, $b) { |
|
146 | + uasort($this->map, function($a, $b) { |
|
147 | 147 | if ($a->metadata->score == $b->metadata->score) { |
148 | 148 | return strnatcasecmp($a->name, $b->name); |
149 | 149 | } |
@@ -65,8 +65,8 @@ |
||
65 | 65 | private function prepare_field(array $config) |
66 | 66 | { |
67 | 67 | if ( empty($config['storage']['location']) |
68 | - // This line is needed because a parameter default is set by the schema parser and then ignored |
|
69 | - // by the type. The things we do for backwards compatibility... |
|
68 | + // This line is needed because a parameter default is set by the schema parser and then ignored |
|
69 | + // by the type. The things we do for backwards compatibility... |
|
70 | 70 | || $config['storage']['location'] === 'parameter') { |
71 | 71 | if (class_exists('midcom\datamanager\storage\\' . $config['type'])) { |
72 | 72 | $classname = 'midcom\datamanager\storage\\' . $config['type']; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | $config['name'] = $name; |
34 | 34 | $field = $this->prepare_field($config); |
35 | - if ( isset($config['default']) |
|
35 | + if (isset($config['default']) |
|
36 | 36 | && (!$this->object->id || $field instanceof transientnode)) { |
37 | 37 | $field->set_value($config['default']); |
38 | 38 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | private function prepare_field(array $config) |
66 | 66 | { |
67 | - if ( empty($config['storage']['location']) |
|
67 | + if (empty($config['storage']['location']) |
|
68 | 68 | // This line is needed because a parameter default is set by the schema parser and then ignored |
69 | 69 | // by the type. The things we do for backwards compatibility... |
70 | 70 | || $config['storage']['location'] === 'parameter') { |
@@ -218,7 +218,8 @@ |
||
218 | 218 | if ($this->_config->get('comments_topic')) { |
219 | 219 | try { |
220 | 220 | $comments_topic = new midcom_db_topic($this->_config->get('comments_topic')); |
221 | - } catch (midcom_error $e) { |
|
221 | + } |
|
222 | + catch (midcom_error $e) { |
|
222 | 223 | return false; |
223 | 224 | } |
224 | 225 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | ]); |
45 | 45 | } |
46 | 46 | |
47 | - if ( $this->_article->topic === $this->_topic->id |
|
47 | + if ($this->_article->topic === $this->_topic->id |
|
48 | 48 | && $this->_article->can_do('midgard:delete')) { |
49 | 49 | $delete = $this->get_workflow('delete', ['object' => $this->_article]); |
50 | 50 | $buttons[] = $delete->get_button("delete/{$this->_article->guid}/"); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | if ($this->_config->get('comments_enable')) { |
97 | 97 | if ($comments_node = $this->_seek_comments()) { |
98 | 98 | $this->_request_data['comments_url'] = $comments_node[MIDCOM_NAV_RELATIVEURL] . "comment/{$this->_article->guid}"; |
99 | - if ( $this->_topic->can_do('midgard:update') |
|
99 | + if ($this->_topic->can_do('midgard:update') |
|
100 | 100 | && $this->_topic->can_do('net.nehmer.comments:moderation')) { |
101 | 101 | net_nehmer_comments_viewer::add_head_elements(); |
102 | 102 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | midcom::get()->auth->require_admin_user(); |
3 | 3 | |
4 | -if ( empty($_POST['to']) |
|
4 | +if (empty($_POST['to']) |
|
5 | 5 | || empty($_POST['from'])) { |
6 | 6 | ?> |
7 | 7 | <h2>Send test email</h2> |
@@ -23,7 +23,7 @@ |
||
23 | 23 | include dirname(__DIR__) . '/config-default.inc.php'; |
24 | 24 | } |
25 | 25 | |
26 | -if (! defined('MIDCOM_STATIC_URL')) { |
|
26 | +if (!defined('MIDCOM_STATIC_URL')) { |
|
27 | 27 | define('MIDCOM_STATIC_URL', '/midcom-static'); |
28 | 28 | } |
29 | 29 |
@@ -77,7 +77,8 @@ discard block |
||
77 | 77 | // if the property useContactAddress is set |
78 | 78 | $billing_data[0]->set_address(); |
79 | 79 | return $billing_data[0]; |
80 | - } catch (midcom_error $e) { |
|
80 | + } |
|
81 | + catch (midcom_error $e) { |
|
81 | 82 | $e->log(); |
82 | 83 | return false; |
83 | 84 | } |
@@ -122,10 +123,12 @@ discard block |
||
122 | 123 | { |
123 | 124 | try { |
124 | 125 | return new org_openpsa_contacts_person_dba($this->linkGuid); |
125 | - } catch (midcom_error $e) { |
|
126 | + } |
|
127 | + catch (midcom_error $e) { |
|
126 | 128 | try { |
127 | 129 | return new org_openpsa_contacts_group_dba($this->linkGuid); |
128 | - } catch (midcom_error $e) { |
|
130 | + } |
|
131 | + catch (midcom_error $e) { |
|
129 | 132 | debug_add("Failed to load contact with GUID: " . $this->linkGuid . " - last error:" . $e->getMessage(), MIDCOM_LOG_ERROR); |
130 | 133 | return false; |
131 | 134 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | public static function get_by_object(org_openpsa_invoices_interfaces_customer $object) |
42 | 42 | { |
43 | 43 | if ( !($bd = self::get_billing_data(org_openpsa_contacts_group_dba::class, $object->customer)) |
44 | - // check if the customerContact is set and has invoice_data |
|
44 | + // check if the customerContact is set and has invoice_data |
|
45 | 45 | && !($bd = self::get_billing_data(org_openpsa_contacts_person_dba::class, $object->customerContact))) { |
46 | 46 | $bd = new org_openpsa_invoices_billing_data_dba(); |
47 | 47 | $due = midcom_baseclasses_components_configuration::get('org.openpsa.invoices', 'config')->get('default_due_days'); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public static function get_by_object(org_openpsa_invoices_interfaces_customer $object) |
42 | 42 | { |
43 | - if ( !($bd = self::get_billing_data(org_openpsa_contacts_group_dba::class, $object->customer)) |
|
43 | + if (!($bd = self::get_billing_data(org_openpsa_contacts_group_dba::class, $object->customer)) |
|
44 | 44 | // check if the customerContact is set and has invoice_data |
45 | 45 | && !($bd = self::get_billing_data(org_openpsa_contacts_person_dba::class, $object->customerContact))) { |
46 | 46 | $bd = new org_openpsa_invoices_billing_data_dba(); |
@@ -48,7 +48,8 @@ |
||
48 | 48 | try { |
49 | 49 | $pdf_helper->render_and_attach(); |
50 | 50 | return $this->reply(true, $this->_l10n->get('pdf created')); |
51 | - } catch (midcom_error $e) { |
|
51 | + } |
|
52 | + catch (midcom_error $e) { |
|
52 | 53 | return $this->reply(false, $this->_l10n->get('pdf creation failed') . ': ' . $e->getMessage()); |
53 | 54 | } |
54 | 55 | } |
@@ -152,7 +152,8 @@ |
||
152 | 152 | debug_add('person #' . $person->id . 'has no email address, aborting'); |
153 | 153 | return false; |
154 | 154 | } |
155 | - } catch (midcom_error $e) { |
|
155 | + } |
|
156 | + catch (midcom_error $e) { |
|
156 | 157 | return false; |
157 | 158 | } |
158 | 159 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $event = new org_openpsa_calendar_event_dba($this->eid); |
70 | 70 | } |
71 | 71 | |
72 | - if ( $recipient->id == midcom_connection::get_user() |
|
72 | + if ($recipient->id == midcom_connection::get_user() |
|
73 | 73 | && !$event->send_notify_me) { |
74 | 74 | //Do not send notification to current user |
75 | 75 | debug_add('event->send_notify_me is false and recipient is current user, aborting notify'); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | return false; |
115 | 115 | } |
116 | 116 | |
117 | - if ( $type == 'cancel' |
|
117 | + if ($type == 'cancel' |
|
118 | 118 | || $type == 'remove') { |
119 | 119 | // TODO: Create iCal export with correct delete commands |
120 | 120 | } else { |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | $workday_starts = 8; |
207 | 207 | $workday_ends = 16; |
208 | 208 | |
209 | - $workday_starts_ts = mktime($workday_starts, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]); |
|
210 | - $workday_ends_ts = mktime($workday_ends, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]); |
|
209 | + $workday_starts_ts = mktime($workday_starts, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]); |
|
210 | + $workday_ends_ts = mktime($workday_ends, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]); |
|
211 | 211 | $last_end_time = false; |
212 | 212 | $last_event = false; |
213 | 213 | foreach ($events as $event) { |
214 | - if ( $event->end <= $workday_starts_ts |
|
214 | + if ($event->end <= $workday_starts_ts |
|
215 | 215 | || $event->start >= $workday_ends_ts) { |
216 | 216 | // We need not to consider this event, it is outside the defined workday |
217 | 217 | continue; |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | if ($last_end_time === false) { |
242 | 242 | $last_end_time = $workday_starts_ts; |
243 | 243 | } |
244 | - if ( $last_end_time < $workday_ends_ts |
|
244 | + if ($last_end_time < $workday_ends_ts |
|
245 | 245 | && (($workday_ends_ts - $last_end_time) >= $amount)) { |
246 | 246 | $slots[] = self::_create_slot($last_end_time, $workday_ends_ts, $last_event); |
247 | 247 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $data['page_title'] = $this->_topic->extra; |
63 | 63 | |
64 | 64 | // Filter by categories |
65 | - if ( $handler_id == 'index-category' |
|
65 | + if ($handler_id == 'index-category' |
|
66 | 66 | || $handler_id == 'latest-category') { |
67 | 67 | $data['category'] = trim(strip_tags($args[0])); |
68 | 68 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | midcom::get()->head->set_pagetitle($this->_request_data['page_title']); |
112 | 112 | |
113 | 113 | // Activate correct leaf |
114 | - if ( $this->_config->get('show_navigation_pseudo_leaves') |
|
114 | + if ($this->_config->get('show_navigation_pseudo_leaves') |
|
115 | 115 | && in_array($this->_request_data['category'], $this->_request_data['categories'])) { |
116 | 116 | $this->set_active_leaf($this->_topic->id . '_CAT_' . $this->_request_data['category']); |
117 | 117 | } |
@@ -141,7 +141,8 @@ discard block |
||
141 | 141 | foreach ($this->_articles as $article_counter => $article) { |
142 | 142 | try { |
143 | 143 | $data['datamanager']->set_storage($article); |
144 | - } catch (midcom_error $e) { |
|
144 | + } |
|
145 | + catch (midcom_error $e) { |
|
145 | 146 | $e->log(); |
146 | 147 | continue; |
147 | 148 | } |
@@ -178,7 +179,8 @@ discard block |
||
178 | 179 | if ($this->_config->get('comments_topic')) { |
179 | 180 | try { |
180 | 181 | $comments_topic = new midcom_db_topic($this->_config->get('comments_topic')); |
181 | - } catch (midcom_error $e) { |
|
182 | + } |
|
183 | + catch (midcom_error $e) { |
|
182 | 184 | return false; |
183 | 185 | } |
184 | 186 |