Passed
Push — master ( cf00ea...cda971 )
by Andreas
09:47
created
admin/asgard/style/midgard_admin_asgard_stylehelper_elementnames.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
             $link = $data['router']->generate('components_component', ['component' => $component]);
8 8
 
9 9
             echo "<li class=\"component\">";
10
-            echo "<a href=\"{$link}\">" . midcom::get()->i18n->get_string($component, $component) ." </a>\n";
10
+            echo "<a href=\"{$link}\">" . midcom::get()->i18n->get_string($component, $component) . " </a>\n";
11 11
             echo "<ul>\n";
12 12
             foreach ($elements as $name => $path) {
13 13
                 echo "<li>";
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/handler/object/manage.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,8 @@
 block discarded – undo
61 61
     {
62 62
         try {
63 63
             $this->_object = midcom::get()->dbfactory->get_object_by_guid($guid);
64
-        } catch (midcom_error $e) {
64
+        }
65
+        catch (midcom_error $e) {
65 66
             if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) {
66 67
                 $relocate = $this->router->generate('object_deleted', ['guid' => $guid]);
67 68
                 midcom::get()->relocate($relocate);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -223,10 +223,10 @@
 block discarded – undo
223 223
             $new_type_reflector = midcom_helper_reflector::get($new_type);
224 224
             $link_properties = $new_type_reflector->get_link_properties();
225 225
             foreach ($link_properties as $property => $link) {
226
-                if (   ($link['class'] && midcom_helper_reflector::is_same_class($link['class'], $this->_object->__mgdschema_class_name__))
226
+                if (($link['class'] && midcom_helper_reflector::is_same_class($link['class'], $this->_object->__mgdschema_class_name__))
227 227
                     || $link['type'] == MGD_TYPE_GUID) {
228 228
                     $defaults[$property] = $this->_object->{$link['target']};
229
-                } elseif (   $property == $parent_property
229
+                } elseif ($property == $parent_property
230 230
                           && midcom_helper_reflector::is_same_class($new_type, $this->_object->__mgdschema_class_name__)) {
231 231
                     $defaults[$property] = $this->_object->$parent_property;
232 232
                 }
Please login to merge, or discard this patch.
lib/org/openpsa/directmarketing/viewer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     private function _populate_node_toolbar()
22 22
     {
23
-        if (   $this->_topic->can_do('midgard:update')
23
+        if ($this->_topic->can_do('midgard:update')
24 24
             && $this->_topic->can_do('midcom:component_config')) {
25 25
             $workflow = $this->get_workflow('datamanager');
26 26
             $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/frontpage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
         }
59 59
         $this->_view_toolbar->add_items($buttons);
60 60
 
61
-        if (   $this->_topic->can_do('midgard:update')
61
+        if ($this->_topic->can_do('midgard:update')
62 62
             && $this->_topic->can_do('midcom:component_config')) {
63 63
             $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [
64 64
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'),
Please login to merge, or discard this patch.
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
@@ -87,7 +87,8 @@  discard block
 block discarded – undo
87 87
                 $customer = org_openpsa_contacts_group_dba::get_cached($invoice->customer);
88 88
                 $entry['customer'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $customer->guid])}\">" . $customer->get_label() . "</a>";
89 89
                 $entry['index_customer'] = $customer->get_label();
90
-            } catch (midcom_error) {
90
+            }
91
+            catch (midcom_error) {
91 92
                 $entry['customer'] = '';
92 93
                 $entry['index_customer'] = '';
93 94
             }
@@ -101,7 +102,8 @@  discard block
 block discarded – undo
101 102
                 $entry['contact'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $contact->guid])}\">" . $contact->get_label() . "</a>";
102 103
                 $entry['contact'] = $contact_widget->show_inline();
103 104
                 $entry['index_contact'] = $contact->get_label();
104
-            } catch (midcom_error) {
105
+            }
106
+            catch (midcom_error) {
105 107
                 $entry['contact'] = '';
106 108
                 $entry['index_contact'] = '';
107 109
             }
@@ -248,7 +250,8 @@  discard block
 block discarded – undo
248 250
     {
249 251
         try {
250 252
             $this->_customer = new org_openpsa_contacts_group_dba($guid);
251
-        } catch (midcom_error) {
253
+        }
254
+        catch (midcom_error) {
252 255
             $this->_customer = new org_openpsa_contacts_person_dba($guid);
253 256
         }
254 257
         $data['customer'] = $this->_customer;
Please login to merge, or discard this patch.
lib/org/openpsa/projects/handler/task/view.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
             MIDCOM_TOOLBAR_ACCESSKEY => 'e',
68 68
         ]);
69 69
 
70
-        if (   $this->task->reportedHours == 0
70
+        if ($this->task->reportedHours == 0
71 71
             && $this->task->can_do('midgard:delete')) {
72 72
             $delete_workflow = $this->get_workflow('delete', ['object' => $this->task]);
73 73
             $buttons[] = $delete_workflow->get_button($this->router->generate('task_delete', ['guid' => $this->task->guid]));
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,8 @@
 block discarded – undo
109 109
                         MIDCOM_TOOLBAR_GLYPHICON => 'money',
110 110
                     ];
111 111
                 }
112
-            } catch (midcom_error) {
112
+            }
113
+            catch (midcom_error) {
113 114
             }
114 115
         }
115 116
 
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
@@ -255,7 +255,8 @@  discard block
 block discarded – undo
255 255
             $url = $this->router->generate('project', ['guid' => $project->guid]);
256 256
             $ret['project'] = '<a href="' . $url . '">' . $project->title . '</a>';
257 257
             $ret['index_project'] = $project->title;
258
-        } catch (midcom_error $e) {
258
+        }
259
+        catch (midcom_error $e) {
259 260
             $e->log();
260 261
         }
261 262
 
@@ -267,7 +268,8 @@  discard block
 block discarded – undo
267 268
                 $customer_url = "{$contacts_url}group/{$customer->guid}/";
268 269
                 $ret['customer'] = "<a href='{$customer_url}' title='{$customer->official}'>{$customer->get_label()}</a>";
269 270
                 $ret['index_customer'] = $customer->name;
270
-            } catch (midcom_error) {
271
+            }
272
+            catch (midcom_error) {
271 273
                 $ret['customer'] = '';
272 274
                 $ret['index_customer'] = '';
273 275
             }
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/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   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * The Default constructor creates an empty privilege, if you specify
76 76
      * another privilege object in the constructor, a copy is constructed.
77 77
      */
78
-    public function __construct(midcom_core_privilege_db|array|string $src = null)
78
+    public function __construct(midcom_core_privilege_db | array | string $src = null)
79 79
     {
80 80
         if (is_array($src)) {
81 81
             // Store given values to our privilege array
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
      * - Any midcom_core_user or midcom_core_group object or subtype thereof.
211 211
      * - Any string identifier which can be resolved using midcom_services_auth::get_assignee().
212 212
      */
213
-    public function set_assignee(midcom_core_group|midcom_core_user|string $assignee) : bool
213
+    public function set_assignee(midcom_core_group | midcom_core_user | string $assignee) : bool
214 214
     {
215 215
         if (is_string($assignee)) {
216 216
             if ($this->is_magic_assignee($assignee)) {
@@ -266,12 +266,12 @@  discard block
 block discarded – undo
266 266
             }
267 267
         }
268 268
 
269
-        if (   !$this->is_magic_assignee()
269
+        if (!$this->is_magic_assignee()
270 270
             && !$this->get_assignee()) {
271 271
             debug_add("The assignee identifier '{$this->assignee}' is invalid.", MIDCOM_LOG_INFO);
272 272
             return false;
273 273
         }
274
-        if (   $this->assignee == 'OWNER'
274
+        if ($this->assignee == 'OWNER'
275 275
             && $this->privilegename == 'midgard:owner') {
276 276
             debug_add("Tried to assign midgard:owner to the OWNER magic assignee, this is invalid.", MIDCOM_LOG_INFO);
277 277
             return false;
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
                 MIDCOM_LOG_INFO);
284 284
             return false;
285 285
         }
286
-        if (   !$object->can_do('midgard:update')
286
+        if (!$object->can_do('midgard:update')
287 287
             || !$object->can_do('midgard:privileges')) {
288 288
             debug_add("Insufficient privileges on the content object with the GUID '{$this->__guid}', midgard:update and midgard:privileges required.",
289 289
                 MIDCOM_LOG_INFO);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,8 @@
 block discarded – undo
112 112
         if ($this->__cached_object === null) {
113 113
             try {
114 114
                 $this->__cached_object = midcom::get()->dbfactory->get_object_by_guid($this->objectguid);
115
-            } catch (midcom_error) {
115
+            }
116
+            catch (midcom_error) {
116 117
                 return null;
117 118
             }
118 119
         }
Please login to merge, or discard this patch.