Passed
Push — master ( 293021...6fdc28 )
by Andreas
12:55
created
lib/midcom/core/user.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
      * 2. A group string identifier, matching the regex ^group:
418 418
      * 3. A valid midcom group name
419 419
      */
420
-    public function is_in_group(midcom_core_group|string $group) : bool
420
+    public function is_in_group(midcom_core_group | string $group) : bool
421 421
     {
422 422
         if ($this->_all_groups === null) {
423 423
             $this->_load_all_groups();
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 
476 476
         $timeout = midcom::get()->config->get('auth_login_session_timeout', 0);
477 477
         $last_seen = $person->get_parameter('midcom', 'online');
478
-        if (   !$last_seen
478
+        if (!$last_seen
479 479
             || ($timeout > 0 && time() - $timeout > $last_seen)) {
480 480
             return 'offline';
481 481
         }
Please login to merge, or discard this patch.
lib/midcom/core/dbaproxy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@
 block discarded – undo
22 22
     /**
23 23
      * MidCOM DBA object identifier, can be ID or GUID
24 24
      */
25
-    private string|int $__identifier;
25
+    private string | int $__identifier;
26 26
 
27 27
     private bool $__tried_to_load = false;
28 28
 
29
-    public function __construct(string|int $identifier, string $classname)
29
+    public function __construct(string | int $identifier, string $classname)
30 30
     {
31 31
         $this->__midcom_class_name__ = $classname;
32 32
         $this->__identifier = $identifier;
Please login to merge, or discard this patch.
lib/org/openpsa/widgets/contact.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     /**
94 94
      * Retrieve an object, uses in-request caching
95 95
      */
96
-    public static function get(string|int $src) : self
96
+    public static function get(string | int $src) : self
97 97
     {
98 98
         static $cache = [];
99 99
 
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
             }
137 137
         }
138 138
 
139
-        if (   $this->_config->get('jabber_enable_presence')
139
+        if ($this->_config->get('jabber_enable_presence')
140 140
             && $person->get_parameter('org.openpsa.jabber', 'jid')) {
141 141
             $this->contact_details['jid'] = $person->get_parameter('org.openpsa.jabber', 'jid');
142 142
         }
143 143
 
144
-        if (   $this->_config->get('skype_enable_presence')
144
+        if ($this->_config->get('skype_enable_presence')
145 145
             && $person->get_parameter('org.openpsa.skype', 'name')) {
146 146
             $this->contact_details['skype'] = $person->get_parameter('org.openpsa.skype', 'name');
147 147
         }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         if (!empty($attachments[$type])) {
179 179
             return '<img class="photo" src="' . midcom_db_attachment::get_url($attachments[$type]) . '">';
180 180
         }
181
-        if (   $this->_config->get('gravatar_enable')
181
+        if ($this->_config->get('gravatar_enable')
182 182
             && !empty($this->contact_details['email'])) {
183 183
             $size = ($type == 'view') ? 500 : 32;
184 184
             $gravatar_url = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->contact_details['email']))) . "?s=" . $size . '&d=identicon';
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
     private function _show_groups()
293 293
     {
294
-        if (   !$this->show_groups
294
+        if (!$this->show_groups
295 295
             || empty($this->contact_details['id'])) {
296 296
             return;
297 297
         }
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
                     $default_shown = true;
356 356
                     $cards_to_show[] = $cardname;
357 357
                 }
358
-            } elseif (    $customer->$property
358
+            } elseif ($customer->$property
359 359
                       || ($customer->street && !$inherited_cards_only && !$default_shown)) {
360 360
                 $inherited_cards_only = false;
361 361
                 $multiple_addresses = true;
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
 
378 378
         foreach ($cards_to_show as $cardname) {
379 379
             echo '<div class="vcard">';
380
-            if (   $multiple_addresses
381
-                || (   $cardname != 'visiting'
380
+            if ($multiple_addresses
381
+                || ($cardname != 'visiting'
382 382
                     && !$inherited_cards_only)) {
383 383
                 echo '<div style="text-align:center"><em>' . midcom::get()->i18n->get_string($cardname . ' address', 'org.openpsa.contacts') . "</em></div>\n";
384 384
             }
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/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.