Test Setup Failed
Pull Request — master (#190)
by
unknown
09:58
created
lib/net/nemein/tag/link.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
             }
134 134
         }
135 135
 
136
-        if (   is_null($position['longitude'])
136
+        if (is_null($position['longitude'])
137 137
             || is_null($position['latitude'])) {
138 138
             // Not enough information for positioning, we need both lon and lat
139 139
             return false;
Please login to merge, or discard this patch.
lib/org/openpsa/calendar/event/member.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $event = new org_openpsa_calendar_event_dba($this->eid);
67 67
         }
68 68
 
69
-        if (    $recipient->id == midcom_connection::get_user()
69
+        if ($recipient->id == midcom_connection::get_user()
70 70
              && !$event->send_notify_me) {
71 71
             //Do not send notification to current user
72 72
             debug_add('event->send_notify_me is false and recipient is current user, aborting notify');
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 return false;
112 112
         }
113 113
 
114
-        if (   $type == 'cancel'
114
+        if ($type == 'cancel'
115 115
             || $type == 'remove') {
116 116
             // TODO: Create iCal export with correct delete commands
117 117
         } else {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         while ($stamp <= $end) {
186 186
             $ymd = date('Ymd', $stamp);
187 187
             debug_add("making sure date {$ymd} has at least one event");
188
-            $stamp = mktime(0, 0, 1, date('m', $stamp), date('d', $stamp)+1, date('Y', $stamp));
188
+            $stamp = mktime(0, 0, 1, date('m', $stamp), date('d', $stamp) + 1, date('Y', $stamp));
189 189
             if (array_key_exists($ymd, $events_by_date)) {
190 190
                 continue;
191 191
             }
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
             $workday_starts = 8;
203 203
             $workday_ends = 16;
204 204
 
205
-            $workday_starts_ts = mktime($workday_starts, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]);
206
-            $workday_ends_ts = mktime($workday_ends, 0, 0, (int)$ymd_matches[2], (int)$ymd_matches[3], (int)$ymd_matches[1]);
205
+            $workday_starts_ts = mktime($workday_starts, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]);
206
+            $workday_ends_ts = mktime($workday_ends, 0, 0, (int) $ymd_matches[2], (int) $ymd_matches[3], (int) $ymd_matches[1]);
207 207
             $last_end_time = false;
208 208
             $last_event = false;
209 209
             foreach ($events as $event) {
210
-                if (   $event->end <= $workday_starts_ts
210
+                if ($event->end <= $workday_starts_ts
211 211
                     || $event->start >= $workday_ends_ts) {
212 212
                     // We need not to consider this event, it is outside the defined workday
213 213
                     continue;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             if ($last_end_time === false) {
239 239
                 $last_end_time = $workday_starts_ts;
240 240
             }
241
-            if (   $last_end_time < $workday_ends_ts
241
+            if ($last_end_time < $workday_ends_ts
242 242
                 && (($workday_ends_ts - $last_end_time) >= $amount)) {
243 243
                 $slots[] = self::_create_slot($last_end_time, $workday_ends_ts, $last_event);
244 244
             }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,7 +150,8 @@  discard block
 block discarded – undo
150 150
                 debug_add('person #' . $person->id . 'has no email address, aborting');
151 151
                 return false;
152 152
             }
153
-        } catch (midcom_error $e) {
153
+        }
154
+        catch (midcom_error $e) {
154 155
             return false;
155 156
         }
156 157
 
@@ -178,7 +179,8 @@  discard block
 block discarded – undo
178 179
         foreach ($eventmembers as $eid) {
179 180
             try {
180 181
                 $event = org_openpsa_calendar_event_dba::get_cached($eid);
181
-            } catch (midcom_error $e) {
182
+            }
183
+            catch (midcom_error $e) {
182 184
                 continue;
183 185
             }
184 186
             $ymd = date('Ymd', $event->start);
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/duplicates/check.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             // if user's lastname is part of the email address, check to see if the difference is only in the domain part
129 129
             $email1 = preg_replace('/@.+/', '', $person1['email']);
130 130
             $email2 = preg_replace('/@.+/', '', $person2['email']);
131
-            if (   strpos($email1, $person1['lastname']) !== false
131
+            if (strpos($email1, $person1['lastname']) !== false
132 132
                 && $email1 == $email2) {
133 133
                 $ret['email_match'] = true;
134 134
                 $ret['p'] += 0.5;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
     private function match($property, array $data1, array $data2)
176 176
     {
177
-        if (   !empty($data1[$property])
177
+        if (!empty($data1[$property])
178 178
             && $data1[$property] == $data2[$property]) {
179 179
             return true;
180 180
         }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
         $persons = $this->get_person_candidates();
326 326
 
327 327
         $params = array();
328
-        $params['objects'] =& $persons;
328
+        $params['objects'] = & $persons;
329 329
         $params['mode'] = 'person';
330 330
 
331 331
         array_walk($persons, array($this, 'check_all_arraywalk'), $params);
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                 continue;
388 388
             }
389 389
 
390
-            if (   $obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid)
390
+            if ($obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid)
391 391
                 || $obj2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj1->guid)) {
392 392
                 // Not-duplicate parameter found, returning zero probability
393 393
                 continue;
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 
416 416
         $groups = $this->get_group_candidates();
417 417
         $params = array();
418
-        $params['objects'] =& $groups;
418
+        $params['objects'] = & $groups;
419 419
         $params['mode'] = 'group';
420 420
         array_walk($groups, array($this, 'check_all_arraywalk'), $params);
421 421
 
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
     {
480 480
         debug_add($message);
481 481
         if ($output) {
482
-            echo $indent . 'INFO: ' . $message  . "<br/>\n";
482
+            echo $indent . 'INFO: ' . $message . "<br/>\n";
483 483
             flush();
484 484
         }
485 485
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -382,7 +382,8 @@
 block discarded – undo
382 382
             try {
383 383
                 $obj1 = $class::get_cached($arr1['guid']);
384 384
                 $obj2 = $class::get_cached($arr2['guid']);
385
-            } catch (midcom_error $e) {
385
+            }
386
+            catch (midcom_error $e) {
386 387
                 $e->log();
387 388
                 continue;
388 389
             }
Please login to merge, or discard this patch.
lib/org/openpsa/directmarketing/handler/message/report.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $qb_receipts->add_constraint('message', '=', $this->_message->id);
55 55
         $qb_receipts->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_messagereceipt_dba::SENT);
56 56
         $receipts = $qb_receipts->execute_unchecked();
57
-        $receipt_data =& $this->_request_data['report']['receipt_data'];
57
+        $receipt_data = & $this->_request_data['report']['receipt_data'];
58 58
         $receipt_data['first_send'] = time();
59 59
         $receipt_data['last_send'] = 0;
60 60
         $receipt_data['sent'] = count($receipts);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
     private function _get_campaign_data($first_send)
89 89
     {
90
-        $campaign_data =& $this->_request_data['report']['campaign_data'];
90
+        $campaign_data = & $this->_request_data['report']['campaign_data'];
91 91
         $qb_unsub = org_openpsa_directmarketing_campaign_member_dba::new_query_builder();
92 92
         $qb_unsub->add_constraint('campaign', '=', $this->_message->campaign);
93 93
         $qb_unsub->add_constraint('orgOpenpsaObtype', '=', org_openpsa_directmarketing_campaign_member_dba::UNSUBSCRIBED);
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
         $campaign_data['next_message'] = false;
96 96
         // Find "next message" and if present use its sendStarted as constraint for this query
97 97
         $qb_messages = org_openpsa_directmarketing_campaign_message_dba::new_query_builder();
98
-        $qb_messages->add_constraint('campaign', '=',  $this->_message->campaign);
99
-        $qb_messages->add_constraint('id', '<>',  $this->_message->id);
98
+        $qb_messages->add_constraint('campaign', '=', $this->_message->campaign);
99
+        $qb_messages->add_constraint('id', '<>', $this->_message->id);
100 100
         $qb_messages->add_constraint('sendStarted', '>', $first_send);
101 101
         $qb_messages->add_order('sendStarted', 'DESC');
102 102
         $qb_messages->set_limit(1);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     private function _get_link_data($segmentation_param)
112 112
     {
113 113
         $this->_request_data['report']['link_data'] = array();
114
-        $link_data =& $this->_request_data['report']['link_data'];
114
+        $link_data = & $this->_request_data['report']['link_data'];
115 115
 
116 116
         $link_data['counts'] = array();
117 117
         $link_data['percentages'] = array('of_links' => array(), 'of_recipients' => array());
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         foreach ($links as $link) {
138 138
             $segment = '';
139 139
             $segment_notfound = false;
140
-            if (   $segmentation_param
140
+            if ($segmentation_param
141 141
                 && !empty($link->person)) {
142 142
                 try {
143 143
                     $person = org_openpsa_contacts_person_dba::get_cached($link->person);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 if (!isset($link_data['segments'][$segment])) {
152 152
                     $link_data['segments'][$segment] = $segment_prototype;
153 153
                 }
154
-                $segment_data =& $link_data['segments'][$segment];
154
+                $segment_data = & $link_data['segments'][$segment];
155 155
             } else {
156 156
                 $segment_data = $segment_prototype;
157 157
             }
@@ -261,15 +261,15 @@  discard block
 block discarded – undo
261 261
         $this->_initialize_field($array['percentages']['of_links'], $link);
262 262
         $this->_initialize_field($array['percentages']['of_recipients'], $link);
263 263
 
264
-        $link_data =& $this->_request_data['report']['link_data'];
265
-        $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total']/$link_data['total'])*100;
266
-        $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/$link_data['total'])*100;
264
+        $link_data = & $this->_request_data['report']['link_data'];
265
+        $array['percentages']['of_links'][$link->target]['total'] = ($array['counts'][$link->target]['total'] / $link_data['total']) * 100;
266
+        $array['percentages']['of_links'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / $link_data['total']) * 100;
267 267
 
268
-        $receipt_data =& $this->_request_data['report']['receipt_data'];
269
-        $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target])-1)/($receipt_data['sent']-$receipt_data['bounced']))*100;
270
-        $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token]/($receipt_data['sent']-$receipt_data['bounced']))*100;
268
+        $receipt_data = & $this->_request_data['report']['receipt_data'];
269
+        $array['percentages']['of_recipients'][$link->target]['total'] = ((count($array['counts'][$link->target]) - 1) / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100;
270
+        $array['percentages']['of_recipients'][$link->target][$link->token] = ($array['counts'][$link->target][$link->token] / ($receipt_data['sent'] - $receipt_data['bounced'])) * 100;
271 271
 
272
-        if (   !isset($array['percentages']['of_recipients']['total'])
272
+        if (!isset($array['percentages']['of_recipients']['total'])
273 273
             || $array['percentages']['of_recipients'][$link->target]['total'] > $array['percentages']['of_recipients']['total']) {
274 274
             $array['percentages']['of_recipients']['total'] = $array['percentages']['of_recipients'][$link->target]['total'];
275 275
         }
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
         $this->_campaign = $this->_master->load_campaign($this->_message->campaign);
336 336
         $data['campaign'] = $this->_campaign;
337 337
 
338
-        if (   isset($_POST['oo_dirmar_userule'])
338
+        if (isset($_POST['oo_dirmar_userule'])
339 339
             && !empty($_POST['oo_dirmar_rule_' . $_POST['oo_dirmar_userule']])) {
340 340
             return $this->_create_campaign_from_link($_POST['oo_dirmar_userule']);
341 341
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,8 @@
 block discarded – undo
142 142
                 try {
143 143
                     $person = org_openpsa_contacts_person_dba::get_cached($link->person);
144 144
                     $segment = $person->get_parameter('org.openpsa.directmarketing.segments', $segmentation_param);
145
-                } catch (midcom_error $e) {
145
+                }
146
+                catch (midcom_error $e) {
146 147
                 }
147 148
                 if (empty($segment)) {
148 149
                     $segment = $this->_l10n->get('no segment');
Please login to merge, or discard this patch.
lib/org/openpsa/documents/midcom/interfaces.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 
40 40
     public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object)
41 41
     {
42
-        if (   $object instanceof org_openpsa_documents_document_dba
42
+        if ($object instanceof org_openpsa_documents_document_dba
43 43
             && $object->topic == $topic->id) {
44 44
             return "document/{$object->guid}/";
45 45
         }
Please login to merge, or discard this patch.
lib/org/openpsa/documents/handler/document/admin.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
  * @package org.openpsa.documents
13 13
  */
14 14
 class org_openpsa_documents_handler_document_admin extends midcom_baseclasses_components_handler
15
- implements midcom_helper_datamanager2_interfaces_create
15
+    implements midcom_helper_datamanager2_interfaces_create
16 16
 {
17 17
     /**
18 18
      * The document we're working with (if any).
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         $this->_controller = $this->get_controller('simple', $this->_document);
116 116
 
117
-        if (   $data['enable_versioning']
117
+        if ($data['enable_versioning']
118 118
             && !empty($_POST)) {
119 119
             $this->_backup_attachment();
120 120
         }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             $prefix = $node[MIDCOM_NAV_ABSOLUTEURL];
145 145
         }
146 146
 
147
-        return $prefix  . "document/" . $this->_document->guid . "/";
147
+        return $prefix . "document/" . $this->_document->guid . "/";
148 148
     }
149 149
 
150 150
     /**
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
         // First, look at post data (from in-form replace/delete buttons)
158 158
         if (!empty($_POST['document'])) {
159 159
             foreach (array_keys($_POST['document']) as $key) {
160
-                if (    strpos($key, '_delete')
161
-                    || (    strpos($key, '_upload')
160
+                if (strpos($key, '_delete')
161
+                    || (strpos($key, '_upload')
162 162
                         && !strpos($key, 'new_upload'))) {
163 163
                     $this->_document->backup_version();
164 164
                     return;
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         // If nothing is found, try looking in quickform (regular form submission)
170 170
         $group = $this->_controller->formmanager->form->getElement('document');
171 171
         foreach ($group->getElements() as $element) {
172
-            if (   preg_match('/e_exist_.+?_file$/', $element->getName())
172
+            if (preg_match('/e_exist_.+?_file$/', $element->getName())
173 173
                 && $element->isUploadedFile()) {
174 174
                 $this->_document->backup_version();
175 175
                 return;
Please login to merge, or discard this patch.
lib/org/openpsa/expenses/viewer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function _on_handle($handler, array $args)
41 41
     {
42
-        if (   strpos($handler, 'index') !== false
42
+        if (strpos($handler, 'index') !== false
43 43
             || strpos($handler, 'list') !== false) {
44 44
             $task = false;
45
-            if (   $handler == 'list_hours_task'
45
+            if ($handler == 'list_hours_task'
46 46
                 || $handler == 'list_hours_task_all') {
47 47
                 $task = $args[0];
48 48
             }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $person_filter->set_label($this->_l10n->get("choose user"));
65 65
         $qf->add_filter($person_filter);
66 66
 
67
-        if (   $this->_request_data['handler_id'] != 'index_timestamp'
67
+        if ($this->_request_data['handler_id'] != 'index_timestamp'
68 68
             && $this->_request_data['handler_id'] != 'index') {
69 69
             $date_filter = new org_openpsa_core_filter_timeframe('date');
70 70
             $date_filter->set_label($this->_l10n->get("timeframe"));
Please login to merge, or discard this patch.
lib/org/openpsa/products/product.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
             $qb->add_constraint('id', '<>', $this->id);
108 108
         }
109 109
         // Make sure the product is in the same product group
110
-        $qb->add_constraint('productGroup', '=', (int)$this->productGroup);
110
+        $qb->add_constraint('productGroup', '=', (int) $this->productGroup);
111 111
 
112 112
         return ($qb->count() == 0);
113 113
     }
Please login to merge, or discard this patch.
lib/org/openpsa/projects/workflow.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     {
171 171
         debug_add("task->start() called with user #" . midcom_connection::get_user());
172 172
         //PONDER: Check actual status objects for more accurate logic ?
173
-        if (   $task->status >= org_openpsa_projects_task_status_dba::STARTED
173
+        if ($task->status >= org_openpsa_projects_task_status_dba::STARTED
174 174
             && $task->status <= org_openpsa_projects_task_status_dba::APPROVED) {
175 175
             //We already have started status
176 176
             debug_add('Task has already been started');
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 
383 383
     private static function is_manager($task)
384 384
     {
385
-        return (   $task->manager == 0
385
+        return ($task->manager == 0
386 386
                 || midcom_connection::get_user() == $task->manager);
387 387
     }
388 388
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -356,7 +356,8 @@
 block discarded – undo
356 356
                 // The agreement allows invoicing only approved hours, therefore don't mark unapproved
357 357
                 $qb->add_constraint('metadata.isapproved', '=', true);
358 358
             }
359
-        } catch (midcom_error $e) {
359
+        }
360
+        catch (midcom_error $e) {
360 361
             $e->log();
361 362
         }
362 363
 
Please login to merge, or discard this patch.