Passed
Push — master ( c56cec...70227f )
by Andreas
09:58
created
lib/org/openpsa/invoices/handler/list.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
171 171
     {
172 172
         $this->prepare_toolbar(false);
173 173
 
174
-        if (   $this->_topic->can_do('midgard:update')
174
+        if ($this->_topic->can_do('midgard:update')
175 175
             && $this->_topic->can_do('midcom:component_config')) {
176 176
             $workflow = $this->get_workflow('datamanager');
177 177
             $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,8 @@  discard block
 block discarded – undo
96 96
                 $customer = org_openpsa_contacts_group_dba::get_cached($invoice->customer);
97 97
                 $entry['customer'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $customer->guid])}\">" . $customer->get_label() . "</a>";
98 98
                 $entry['index_customer'] = $customer->get_label();
99
-            } catch (midcom_error $e) {
99
+            }
100
+            catch (midcom_error $e) {
100 101
                 $entry['customer'] = '';
101 102
                 $entry['index_customer'] = '';
102 103
             }
@@ -110,7 +111,8 @@  discard block
 block discarded – undo
110 111
                 $entry['contact'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $contact->guid])}\">" . $contact->get_label() . "</a>";
111 112
                 $entry['contact'] = $contact_widget->show_inline();
112 113
                 $entry['index_contact'] = $contact->get_label();
113
-            } catch (midcom_error $e) {
114
+            }
115
+            catch (midcom_error $e) {
114 116
                 $entry['contact'] = '';
115 117
                 $entry['index_contact'] = '';
116 118
             }
@@ -257,7 +259,8 @@  discard block
 block discarded – undo
257 259
     {
258 260
         try {
259 261
             $this->_customer = new org_openpsa_contacts_group_dba($guid);
260
-        } catch (midcom_error $e) {
262
+        }
263
+        catch (midcom_error $e) {
261 264
             $this->_customer = new org_openpsa_contacts_person_dba($guid);
262 265
         }
263 266
         $data['customer'] = $this->_customer;
Please login to merge, or discard this patch.
lib/org/openpsa/projects/handler/task/list.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
             case 'proposed':
170 170
                 $html = $this->render_status($task->manager, "from %s");
171 171
                 $task->get_members();
172
-                if (   $task->can_do('midgard:update')
172
+                if ($task->can_do('midgard:update')
173 173
                     && isset($task->resources[midcom_connection::get_user()])) {
174 174
                     $html .= '<form method="post" action="' . $this->router->generate('workflow', ['guid' => $task->guid]) . '">';
175 175
                     //TODO: If we need all resources to accept task hide tools when we have accepted and replace with "pending acceptance from..."
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -291,7 +291,8 @@  discard block
 block discarded – undo
291 291
             $url = $this->router->generate('project', ['guid' => $project->guid]);
292 292
             $ret['project'] = '<a href="' . $url . '">' . $project->title . '</a>';
293 293
             $ret['index_project'] = $project->title;
294
-        } catch (midcom_error $e) {
294
+        }
295
+        catch (midcom_error $e) {
295 296
             $e->log();
296 297
         }
297 298
 
@@ -303,7 +304,8 @@  discard block
 block discarded – undo
303 304
                 $customer_url = "{$contacts_url}group/{$customer->guid}/";
304 305
                 $ret['customer'] = "<a href='{$customer_url}' title='{$customer->official}'>{$customer->get_label()}</a>";
305 306
                 $ret['index_customer'] = $customer->name;
306
-            } catch (midcom_error $e) {
307
+            }
308
+            catch (midcom_error $e) {
307 309
                 $ret['customer'] = '';
308 310
                 $ret['index_customer'] = '';
309 311
             }
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/handler/scheduled.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,8 @@  discard block
 block discarded – undo
61 61
         try {
62 62
             $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($at_entry->arguments['deliverable']);
63 63
             $salesproject = org_openpsa_sales_salesproject_dba::get_cached($deliverable->salesproject);
64
-        } catch (midcom_error $e) {
64
+        }
65
+        catch (midcom_error $e) {
65 66
             $e->log();
66 67
             return $invoice;
67 68
         }
@@ -103,7 +104,8 @@  discard block
 block discarded – undo
103 104
                     $invoice[$fieldname] = '<a href="' . $sales_url . 'list/customer/' . $object->guid . '/">' . $invoice[$fieldname] . '</a>';
104 105
                 }
105 106
                 $invoice['index_' . $fieldname] = $object->get_label();
106
-            } catch (midcom_error $e) {
107
+            }
108
+            catch (midcom_error $e) {
107 109
                 $e->log();
108 110
             }
109 111
         }
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/handler/invoice/items.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@  discard block
 block discarded – undo
48 48
                 if ($sales_url) {
49 49
                     $entry['deliverable'] = '<a href="' . $sales_url . 'deliverable/' . $deliverable->guid . '/">' . $entry['deliverable'] . '</a>';
50 50
                 }
51
-            } catch (midcom_error $e) {
51
+            }
52
+            catch (midcom_error $e) {
52 53
                 $entry['deliverable'] = '';
53 54
             }
54 55
             try {
@@ -57,7 +58,8 @@  discard block
 block discarded – undo
57 58
                 if ($projects_url) {
58 59
                     $entry['task'] = '<a href="' . $projects_url . 'task/' . $task->guid . '/">' . $entry['task'] . '</a>';
59 60
                 }
60
-            } catch (midcom_error $e) {
61
+            }
62
+            catch (midcom_error $e) {
61 63
                 $entry['task'] = '';
62 64
             }
63 65
 
Please login to merge, or discard this patch.
lib/org/openpsa/calendar/conflictmanager.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -195,7 +195,8 @@  discard block
 block discarded – undo
195 195
             try {
196 196
                 $event = new org_openpsa_calendar_event_dba($member->event);
197 197
                 $set_as_modified = true;
198
-            } catch (midcom_error $e) {
198
+            }
199
+            catch (midcom_error $e) {
199 200
                 debug_add("event_resource #{$member->id} links to bogus event #{$member->event}, skipping and removing", MIDCOM_LOG_WARN);
200 201
                 $member->delete();
201 202
                 return;
@@ -223,7 +224,8 @@  discard block
 block discarded – undo
223 224
 
224 225
         try {
225 226
             $event = new org_openpsa_calendar_event_dba($member->eid);
226
-        } catch (midcom_error $e) {
227
+        }
228
+        catch (midcom_error $e) {
227 229
             debug_add("eventmember #{$member->id} links to bogus event #{$member->eid}, skipping and removing", MIDCOM_LOG_WARN);
228 230
             $member->delete();
229 231
             return;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         }
126 126
         // TODO: Shared tasks need a separate check (different member object)
127 127
 
128
-        if (   !empty($this->busy_members)
128
+        if (!empty($this->busy_members)
129 129
             || !empty($this->busy_resources)) {
130 130
             //Unresolved conflicts (note return value is for conflicts not lack of them)
131 131
             midcom::get()->auth->drop_sudo();
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         }
189 189
 
190 190
         if (array_key_exists($member->event, $modified_events)) {
191
-            $event =& $modified_events[$member->event];
191
+            $event = & $modified_events[$member->event];
192 192
             $set_as_modified = false;
193 193
         } else {
194 194
             try {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         }
203 203
         debug_add("overlap found in event {$event->title} (#{$event->id})");
204 204
 
205
-        if (   $event->tentative
205
+        if ($event->tentative
206 206
             && $rob_tentative) {
207 207
             debug_add('event is tentative, robbing resources');
208 208
             $event->resources = array_diff_key($event->resources, $this->_event->resources);
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         }
230 230
         debug_add("overlap found in event {$event->title} (#{$event->id})");
231 231
 
232
-        if (   $event->tentative
232
+        if ($event->tentative
233 233
             && $rob_tentative) {
234 234
             debug_add('event is tentative, robbing participants');
235 235
             $event->participants = array_diff_key($event->participants, $this->_event->participants);
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/transformer/jsdateTransformer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
             }
34 34
         }
35 35
 
36
-        if (   empty($input)
37
-            || (   $input instanceof DateTime
36
+        if (empty($input)
37
+            || ($input instanceof DateTime
38 38
                 && $input->format('Y-m-d H:i:s') == '0001-01-01 00:00:00')) {
39 39
             return $result;
40 40
         }
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
             throw new TransformationFailedException('Expected an array.');
60 60
         }
61 61
 
62
-        if (   empty($array['date'])
63
-            || (   $array['date'] instanceof DateTime
62
+        if (empty($array['date'])
63
+            || ($array['date'] instanceof DateTime
64 64
                 && $array['date']->format('Y-m-d H:i:s') == '0001-01-01 00:00:00')) {
65 65
             return;
66 66
         }
Please login to merge, or discard this patch.
lib/midcom/core/privilege.php 3 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,6 @@
 block discarded – undo
37 37
                 - 1: MIDCOM_PRIVILEGE_ALLOW
38 38
                 - 2: MIDCOM_PRIVILEGE_DENY
39 39
                 - 3: MIDCOM_PRIVILEGE_INHERIT
40
-
41 40
  * @property string $guid
42 41
  * @package midcom
43 42
  */
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
      */
247 247
     public function set_assignee($assignee) : bool
248 248
     {
249
-        if (   is_a($assignee, midcom_core_user::class)
249
+        if (is_a($assignee, midcom_core_user::class)
250 250
             || is_a($assignee, midcom_core_group::class)) {
251 251
             $this->assignee = $assignee->id;
252 252
         } elseif (is_string($assignee)) {
@@ -305,12 +305,12 @@  discard block
 block discarded – undo
305 305
             }
306 306
         }
307 307
 
308
-        if (   !$this->is_magic_assignee()
308
+        if (!$this->is_magic_assignee()
309 309
             && !$this->get_assignee()) {
310 310
             debug_add("The assignee identifier '{$this->assignee}' is invalid.", MIDCOM_LOG_INFO);
311 311
             return false;
312 312
         }
313
-        if (   $this->assignee == 'OWNER'
313
+        if ($this->assignee == 'OWNER'
314 314
             && $this->privilegename == 'midgard:owner') {
315 315
             debug_add("Tried to assign midgard:owner to the OWNER magic assignee, this is invalid.", MIDCOM_LOG_INFO);
316 316
             return false;
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
                 MIDCOM_LOG_INFO);
323 323
             return false;
324 324
         }
325
-        if (   !$object->can_do('midgard:update')
325
+        if (!$object->can_do('midgard:update')
326 326
             || !$object->can_do('midgard:privileges')) {
327 327
             debug_add("Insufficient privileges on the content object with the GUID '{$this->__guid}', midgard:update and midgard:privileges required.",
328 328
                 MIDCOM_LOG_INFO);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,8 @@
 block discarded – undo
124 124
         if ($this->__cached_object === null) {
125 125
             try {
126 126
                 $this->__cached_object = midcom::get()->dbfactory->get_object_by_guid($this->objectguid);
127
-            } catch (midcom_error $e) {
127
+            }
128
+            catch (midcom_error $e) {
128 129
                 return null;
129 130
             }
130 131
         }
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/subscriber/purifySubscriber.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     public function purify_content(FormEvent $event)
42 42
     {
43
-        if (   isset($this->config['Cache']['SerializerPath'])
43
+        if (isset($this->config['Cache']['SerializerPath'])
44 44
             && !file_exists($this->config['Cache']['SerializerPath'])) {
45 45
             mkdir($this->config['Cache']['SerializerPath']);
46 46
         }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
         // Load custom element/attribute definitions
56 56
         $definitions = $this->get_from_global_config('html_purify_HTMLDefinition');
57
-        if (   !empty($definitions)
57
+        if (!empty($definitions)
58 58
             && $def = $purifier_config->maybeGetRawHTMLDefinition()) {
59 59
             if (!empty($definitions['addAttribute'])) {
60 60
                 foreach (array_filter((array) $definitions['addAttribute'], 'is_array') as $attrdef) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,8 @@
 block discarded – undo
72 72
         $data = $event->getData();
73 73
         try {
74 74
             $data = $purifier->purify($data);
75
-        } catch (\Exception $e) {
75
+        }
76
+        catch (\Exception $e) {
76 77
             debug_add("HTML Purifier failed: " . $e->getMessage(), MIDCOM_LOG_WARN);
77 78
         }
78 79
         $event->setData($data);
Please login to merge, or discard this patch.
lib/org/openpsa/documents/elFinderVolumeOpenpsa.php 2 patches
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,7 +85,8 @@  discard block
 block discarded – undo
85 85
 
86 86
         $this->clearcache();
87 87
 
88
-        if ($file && $file['name'] === $name) { // file exists and check filename for item ID based filesystem
88
+        if ($file && $file['name'] === $name) {
89
+// file exists and check filename for item ID based filesystem
89 90
             if ($this->uploadOverwrite) {
90 91
                 if (!$file['write']) {
91 92
                     return $this->setError(elFinder::ERROR_PERM_DENIED);
@@ -142,11 +143,13 @@  discard block
 block discarded – undo
142 143
     {
143 144
         try {
144 145
             return org_openpsa_documents_document_dba::get_cached($path);
145
-        } catch (midcom_error $e) {
146
+        }
147
+        catch (midcom_error $e) {
146 148
             $e->log();
147 149
             try {
148 150
                 return org_openpsa_documents_directory::get_cached($path);
149
-            } catch (midcom_error $e) {
151
+            }
152
+            catch (midcom_error $e) {
150 153
                 $e->log();
151 154
             }
152 155
         }
@@ -282,7 +285,8 @@  discard block
 block discarded – undo
282 285
         $object = midcom::get()->dbfactory->get_object_by_guid($path);
283 286
         try {
284 287
             $parentdir = org_openpsa_documents_directory::get_cached($parent);
285
-        } catch (midcom_error $e) {
288
+        }
289
+        catch (midcom_error $e) {
286 290
             $e->log();
287 291
             return false;
288 292
         }
@@ -579,7 +583,8 @@  discard block
 block discarded – undo
579 583
         try {
580 584
             $doc = new org_openpsa_documents_document_dba($path);
581 585
             return $doc->delete();
582
-        } catch (midcom_error $e) {
586
+        }
587
+        catch (midcom_error $e) {
583 588
             return false;
584 589
         }
585 590
     }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             return $this->setError(elFinder::ERROR_UPLOAD_FILE_MIME, '(' . $mime . ')');
68 68
         }
69 69
 
70
-        $tmpsize = (int)sprintf('%u', filesize($tmpname));
70
+        $tmpsize = (int) sprintf('%u', filesize($tmpname));
71 71
         if ($this->uploadMaxSize > 0 && $tmpsize > $this->uploadMaxSize) {
72 72
             return $this->setError(elFinder::ERROR_UPLOAD_FILE_SIZE);
73 73
         }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         $output = [$object->get_label()];
251 251
 
252 252
         $parent = $object->get_parent();
253
-        while (   $parent
253
+        while ($parent
254 254
                && $parent->component == 'org.openpsa.documents') {
255 255
             $output[] = $parent->extra;
256 256
             $parent = $parent->get_parent();
@@ -347,12 +347,12 @@  discard block
 block discarded – undo
347 347
             $data['mime'] = 'directory';
348 348
         }
349 349
 
350
-        if (   $owner
350
+        if ($owner
351 351
             && $group = midcom::get()->auth->get_assignee($owner)) {
352 352
             $data['group'] = $group->name;
353 353
         }
354 354
 
355
-        if (   $this->root !== $path
355
+        if ($this->root !== $path
356 356
             && $parent = $object->get_parent()) {
357 357
             $data['phash'] = $this->encode($parent->guid);
358 358
         }
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
      * @param  string $mode open mode
412 412
      * @return resource|false
413 413
      */
414
-    protected function _fopen($path, $mode="rb")
414
+    protected function _fopen($path, $mode = "rb")
415 415
     {
416 416
         $document = org_openpsa_documents_document_dba::get_cached($path);
417 417
         $attachments = blobs::get_attachments($document, 'document');
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
      * @param  string    $path  file path
430 430
      * @return bool
431 431
      */
432
-    protected function _fclose($fp, $path='')
432
+    protected function _fclose($fp, $path = '')
433 433
     {
434 434
         fclose($fp);
435 435
         return true;
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
     {
612 612
         $filename = midcom_db_attachment::safe_filename($name);
613 613
         $att = $doc->create_attachment($filename, $name, $mimetype);
614
-        if (   !$att
614
+        if (!$att
615 615
             || !$att->copy_from_handle($fp)) {
616 616
             return false;
617 617
         }
Please login to merge, or discard this patch.