Passed
Push — master ( 2874e4...bdfe16 )
by Andreas
11:31
created
lib/midcom/helper/metadata.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     {
255 255
         if (in_array($key, $this->field_config['timebased'])) {
256 256
             // This is ugly, but seems the only possible way...
257
-            if (   isset($this->__metadata->$key)
257
+            if (isset($this->__metadata->$key)
258 258
                 && (string) $this->__metadata->$key !== "0001-01-01T00:00:00+00:00") {
259 259
                 return (int) $this->__metadata->$key->format('U');
260 260
             }
@@ -315,11 +315,11 @@  discard block
 block discarded – undo
315 315
         }
316 316
 
317 317
         $now = time();
318
-        if (   $this->get('schedulestart')
318
+        if ($this->get('schedulestart')
319 319
             && $this->get('schedulestart') > $now) {
320 320
             return false;
321 321
         }
322
-        if (   $this->get('scheduleend')
322
+        if ($this->get('scheduleend')
323 323
             && $this->get('scheduleend') < $now) {
324 324
             return false;
325 325
         }
@@ -335,9 +335,9 @@  discard block
 block discarded – undo
335 335
     public function is_object_visible_onsite() : bool
336 336
     {
337 337
         return
338
-        (   (   midcom::get()->config->get('show_hidden_objects')
338
+        ((midcom::get()->config->get('show_hidden_objects')
339 339
              || $this->is_visible())
340
-         && (   midcom::get()->config->get('show_unapproved_objects')
340
+         && (midcom::get()->config->get('show_unapproved_objects')
341 341
              || $this->is_approved())
342 342
         );
343 343
     }
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             $guid = $source;
395 395
         }
396 396
 
397
-        if (   $object === null
397
+        if ($object === null
398 398
             && mgd_is_guid($guid)) {
399 399
             try {
400 400
                 $object = midcom::get()->dbfactory->get_object_by_guid($guid);
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
         }
428 428
 
429 429
         // Lock was created by the user, return "not locked"
430
-        if (   !empty(midcom::get()->auth->user->guid)
430
+        if (!empty(midcom::get()->auth->user->guid)
431 431
             && $this->get('locker') === midcom::get()->auth->user->guid) {
432 432
             return false;
433 433
         }
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
      */
455 455
     public function can_unlock() : bool
456 456
     {
457
-        return (  (midcom::get()->auth->user && midcom::get()->auth->user->guid == $this->__object->metadata->locker)
457
+        return ((midcom::get()->auth->user && midcom::get()->auth->user->guid == $this->__object->metadata->locker)
458 458
                 || $this->__object->can_do('midcom:unlock')
459 459
                 || midcom::get()->auth->can_user_do('midcom:unlock', class: midcom_services_auth::class));
460 460
     }
Please login to merge, or discard this patch.
lib/midcom/helper/toolbar/node.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         }
55 55
         $buttons = [];
56 56
         $workflow = new midcom\workflow\datamanager;
57
-        if (   $this->topic->can_do('midgard:update')
57
+        if ($this->topic->can_do('midgard:update')
58 58
             && $this->topic->can_do('midcom.admin.folder:topic_management')) {
59 59
             $buttons[] = $workflow->get_button("__ais/folder/edit/", [
60 60
                 MIDCOM_TOOLBAR_LABEL => midcom::get()->i18n->get_string('edit folder', 'midcom.admin.folder'),
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             ];
90 90
         }
91 91
         $buttons = array_merge($buttons, $this->get_approval_controls($this->topic, false));
92
-        if (   $this->topic->can_do('midcom.admin.folder:template_management')
92
+        if ($this->topic->can_do('midcom.admin.folder:template_management')
93 93
             && midcom::get()->auth->can_user_do('midgard.admin.asgard:manage_objects', class: 'midgard_admin_asgard_plugin')) {
94 94
             $enabled = false;
95 95
             $styleeditor_url = '';
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                     MIDCOM_TOOLBAR_ACCESSKEY => 'f',
123 123
                 ]);
124 124
             }
125
-            if (   $this->topic->guid !== midcom::get()->config->get('midcom_root_topic_guid')
125
+            if ($this->topic->guid !== midcom::get()->config->get('midcom_root_topic_guid')
126 126
                 && $this->topic->can_do('midgard:delete')) {
127 127
                 $workflow = new midcom\workflow\delete(['object' => $this->topic, 'recursive' => true]);
128 128
                 $buttons[] = $workflow->get_button("__ais/folder/delete/", [
Please login to merge, or discard this patch.
lib/midcom/services/uimessages.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
     public function show(bool $show_simple = false)
135 135
     {
136
-        if (   $show_simple
136
+        if ($show_simple
137 137
             || !midcom::get()->auth->can_user_do('midcom:ajax', class: static::class)) {
138 138
             $this->show_simple();
139 139
             return;
Please login to merge, or discard this patch.
lib/midcom/services/toolbars.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@
 block discarded – undo
272 272
 
273 273
     private function add_head_elements(bool $centralized = false) : bool
274 274
     {
275
-        if (   !midcom::get()->auth->user
275
+        if (!midcom::get()->auth->user
276 276
             || !midcom::get()->config->get('toolbars_enable_centralized')
277 277
             || !midcom::get()->auth->can_user_do('midcom:centralized_toolbar', class: __CLASS__)) {
278 278
             return false;
Please login to merge, or discard this patch.
lib/midcom/baseclasses/core/dbobject.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
         if ($parent = $object->get_parent()) {
120 120
             // Attachments are a special case
121 121
             if ($object instanceof midcom_db_attachment) {
122
-                if (   !$parent->can_do('midgard:attachments')
122
+                if (!$parent->can_do('midgard:attachments')
123 123
                     || !$parent->can_do('midgard:update')) {
124 124
                     debug_add("Failed to create attachment, update or attachments privilege on the parent " . get_class($parent) . " {$parent->guid} not granted for the current user.",
125 125
                         MIDCOM_LOG_ERROR);
126 126
                     midcom_connection::set_error(MGD_ERR_ACCESS_DENIED);
127 127
                     return false;
128 128
                 }
129
-            } elseif (   !$parent->can_do('midgard:create')
129
+            } elseif (!$parent->can_do('midgard:create')
130 130
                       && !midcom::get()->auth->can_user_do('midgard:create', class: get_class($object))) {
131 131
                 debug_add("Failed to create object, create privilege on the parent " . get_class($parent) . " {$parent->guid} or the actual object class not granted for the current user.",
132 132
                     MIDCOM_LOG_ERROR);
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             }
239 239
 
240 240
             // Default the owner to first group of current user
241
-            if (   empty($object->metadata->owner)
241
+            if (empty($object->metadata->owner)
242 242
                 && $first_group = midcom::get()->auth->user->get_first_group_guid()) {
243 243
                 $object->metadata->set('owner', $first_group);
244 244
             }
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
      */
463 463
     public static function get_by_guid(midcom_core_dbaobject $object, string $guid) : bool
464 464
     {
465
-        if (   !midcom::get()->auth->admin
465
+        if (!midcom::get()->auth->admin
466 466
             && !midcom::get()->auth->acl->can_do_byguid('midgard:read', $guid, get_class($object), midcom::get()->auth->acl->get_user_id())) {
467 467
             debug_add("Failed to load object, read privilege on the " . get_class($object) . " {$guid} not granted for the current user.", MIDCOM_LOG_ERROR);
468 468
             return false;
Please login to merge, or discard this patch.
lib/org/openpsa/expenses/handler/index.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,8 @@  discard block
 block discarded – undo
103 103
         foreach ($hours as $guid => $row) {
104 104
             try {
105 105
                 $task = org_openpsa_projects_task_dba::get_cached($row['task']);
106
-            } catch (midcom_error $e) {
106
+            }
107
+            catch (midcom_error $e) {
107 108
                 // Task couldn't be loaded, probably because of ACL
108 109
                 continue;
109 110
             }
@@ -116,7 +117,8 @@  discard block
 block discarded – undo
116 117
                     $person_object = midcom_db_person::get_cached($row['person']);
117 118
                     $person_label = $this->_get_list_link($person_object->name, person_id: $row['person']);
118 119
                     $person_name = $person_object->name;
119
-                } catch (midcom_error $e) {
120
+                }
121
+                catch (midcom_error $e) {
120 122
                     $person_label = $this->_l10n->get('no person');
121 123
                     $person_name = '';
122 124
                 }
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/person/view.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $invoices_url = $siteconfig->get_node_full_url('org.openpsa.invoices');
100 100
         $user_url = $siteconfig->get_node_full_url('org.openpsa.user');
101 101
 
102
-        if (   $invoices_url
102
+        if ($invoices_url
103 103
             && midcom::get()->auth->can_user_do('midgard:create', class: org_openpsa_invoices_invoice_dba::class)
104 104
             && $this->_contact->can_do('midgard:update')) {
105 105
             $buttons[] = $workflow->get_button($invoices_url . "billingdata/" . $this->_contact->guid . '/', [
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
             ]);
109 109
         }
110 110
 
111
-        if (   $user_url
112
-            && (   midcom::get()->auth->user->guid == $this->_contact->guid
111
+        if ($user_url
112
+            && (midcom::get()->auth->user->guid == $this->_contact->guid
113 113
                 || midcom::get()->auth->can_user_do('org.openpsa.user:access', class: org_openpsa_user_interface::class))) {
114 114
             $buttons[] = [
115 115
                 MIDCOM_TOOLBAR_URL => $user_url . "view/{$this->_contact->guid}/",
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/group/view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             ];
45 45
         }
46 46
 
47
-        if (   midcom::get()->auth->can_user_do('midgard:create', class: org_openpsa_contacts_person_dba::class)
47
+        if (midcom::get()->auth->can_user_do('midgard:create', class: org_openpsa_contacts_person_dba::class)
48 48
             && $this->group->can_do('midgard:create')) {
49 49
                 $buttons[] = $workflow->get_button($this->router->generate('person_new_group', ['guid' => $this->group->guid]), [
50 50
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create person'),
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
         $siteconfig = org_openpsa_core_siteconfig::get_instance();
56 56
         $user_url = $siteconfig->get_node_full_url('org.openpsa.user');
57
-        if (   $user_url
57
+        if ($user_url
58 58
             && midcom::get()->auth->can_user_do('org.openpsa.user:access', class: org_openpsa_user_interface::class)) {
59 59
             $buttons[] = [
60 60
                 MIDCOM_TOOLBAR_URL => $user_url . "group/{$this->group->guid}/",
Please login to merge, or discard this patch.
lib/org/openpsa/user/style/show-person-account.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
             echo '<p>' . sprintf($data['l10n']->get('account blocked %s minutes'), $data['config']->get('password_block_timeframe_min')) . '</p>';
17 17
         }
18 18
 
19
-        if (   $data['person']->guid == midcom::get()->auth->user->guid
19
+        if ($data['person']->guid == midcom::get()->auth->user->guid
20 20
             || midcom::get()->auth->can_user_do('org.openpsa.user:manage', class: org_openpsa_user_interface::class)) {
21 21
             $workflow = new midcom\workflow\datamanager;
22 22
             echo '<ul class="area_toolbar">';
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
                 'object' => $data['person'],
26 26
                 'label' => $data['l10n']->get('account')
27 27
             ]);
28
-            echo '<li><a href="' . $data['router']->generate('account_delete', ['guid' => $data['person']->guid]). '" ' . $workflow->render_attributes() . ' class="button">';
28
+            echo '<li><a href="' . $data['router']->generate('account_delete', ['guid' => $data['person']->guid]) . '" ' . $workflow->render_attributes() . ' class="button">';
29 29
             echo '<span class="toolbar_label">' . $data['l10n_midcom']->get('delete') . '</span></a></li>';
30
-            if (    midcom::get()->config->get('auth_allow_trusted') === true
30
+            if (midcom::get()->config->get('auth_allow_trusted') === true
31 31
                  && $data['person']->can_do('org.openpsa.user:su')) {
32 32
                  echo '<li><a class="button" href="' . $data['router']->generate('account_su', ['guid' => $data['person']->guid]) . '">' . $data['l10n']->get('switch to user') . "</a></li>\n";
33 33
             }
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         }
36 36
     } else {
37 37
         echo '<p><span class="metadata">' . $data['l10n']->get("no account") . '</span></p>';
38
-        if (   $data['person']->guid == midcom::get()->auth->user->guid
38
+        if ($data['person']->guid == midcom::get()->auth->user->guid
39 39
             || midcom::get()->auth->can_user_do('org.openpsa.user:manage', class: org_openpsa_user_interface::class)) {
40 40
             $workflow = new midcom\workflow\datamanager;
41 41
             echo '<ul class="area_toolbar">';
Please login to merge, or discard this patch.