Passed
Push — master ( eb3d65...8de60e )
by Andreas
18:09
created
lib/org/openpsa/user/style/show-person-account.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
             echo '<p>' . $data['l10n']->get('last login') . ': ' . $formatter->datetime($lastlogin) . "</p>\n";
12 12
         }
13 13
 
14
-        if (   $data['person']->guid == midcom::get()->auth->user->guid
14
+        if ($data['person']->guid == midcom::get()->auth->user->guid
15 15
             || midcom::get()->auth->can_user_do('org.openpsa.user:manage', null, org_openpsa_user_interface::class)) {
16 16
             $workflow = new midcom\workflow\datamanager;
17 17
             echo '<ul class="area_toolbar">';
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
                 'object' => $data['person'],
21 21
                 'label' => $data['l10n']->get('account')
22 22
             ]);
23
-            echo '<li><a href="' . $data['router']->generate('account_delete', ['guid' => $data['person']->guid]). '" ' . $workflow->render_attributes() . '"  class="button">';
23
+            echo '<li><a href="' . $data['router']->generate('account_delete', ['guid' => $data['person']->guid]) . '" ' . $workflow->render_attributes() . '"  class="button">';
24 24
             echo '<span class="toolbar_label">' . $data['l10n_midcom']->get('delete') . '</span></a></li>';
25
-            if (    midcom::get()->config->get('auth_allow_trusted') === true
25
+            if (midcom::get()->config->get('auth_allow_trusted') === true
26 26
                  && $data['person']->can_do('org.openpsa.user:su')) {
27 27
                  echo '<li><a class="button" href="' . $data['router']->generate('account_su', ['guid' => $data['person']->guid]) . '">' . $data['l10n']->get('switch to user') . "</a></li>\n";
28 28
             }
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         }
31 31
     } else {
32 32
         echo '<p><span class="metadata">' . $data['l10n']->get("no account") . '</span></p>';
33
-        if (   $data['person']->guid == midcom::get()->auth->user->guid
33
+        if ($data['person']->guid == midcom::get()->auth->user->guid
34 34
             || midcom::get()->auth->can_user_do('org.openpsa.user:manage', null, org_openpsa_user_interface::class)) {
35 35
             $workflow = new midcom\workflow\datamanager;
36 36
             echo '<ul class="area_toolbar">';
Please login to merge, or discard this patch.
lib/org/openpsa/user/handler/person/view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         $this->add_breadcrumb('', $person->get_label());
25 25
 
26 26
         $auth = midcom::get()->auth;
27
-        if (   $person->guid == midcom::get()->auth->user->guid
27
+        if ($person->guid == midcom::get()->auth->user->guid
28 28
             || $auth->can_user_do('org.openpsa.user:manage', null, org_openpsa_user_interface::class)) {
29 29
             $buttons = [];
30 30
             $workflow = $this->get_workflow('datamanager');
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                 $delete_workflow = $this->get_workflow('delete', ['object' => $person]);
38 38
                 $buttons[] = $delete_workflow->get_button($this->router->generate('user_delete', ['guid' => $person->guid]));
39 39
             }
40
-            if (   midcom_connection::is_user($person)
40
+            if (midcom_connection::is_user($person)
41 41
                 && $person->can_do('midgard:privileges')) {
42 42
                 $buttons[] = $workflow->get_button($this->router->generate('user_privileges', ['guid' => $person->guid]), [
43 43
                     MIDCOM_TOOLBAR_LABEL => $this->_l10n->get("permissions"),
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
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $invoices_url = $siteconfig->get_node_full_url('org.openpsa.invoices');
106 106
         $user_url = $siteconfig->get_node_full_url('org.openpsa.user');
107 107
 
108
-        if (   $invoices_url
108
+        if ($invoices_url
109 109
             && midcom::get()->auth->can_user_do('midgard:create', null, org_openpsa_invoices_invoice_dba::class)
110 110
             && $this->_contact->can_do('midgard:update')) {
111 111
             $buttons[] = $workflow->get_button($invoices_url . "billingdata/" . $this->_contact->guid . '/', [
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
             ]);
115 115
         }
116 116
 
117
-        if (   $user_url
118
-            && (   midcom::get()->auth->user->guid == $this->_contact->guid
117
+        if ($user_url
118
+            && (midcom::get()->auth->user->guid == $this->_contact->guid
119 119
                 || midcom::get()->auth->can_user_do('org.openpsa.user:access', null, org_openpsa_user_interface::class))) {
120 120
             $buttons[] = [
121 121
                 MIDCOM_TOOLBAR_URL => $user_url . "view/{$this->_contact->guid}/",
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/duplicates/check.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
     protected function match(string $property, array $data1, array $data2) : bool
115 115
     {
116
-        if (   !empty($data1[$property])
116
+        if (!empty($data1[$property])
117 117
             && $data1[$property] == $data2[$property]) {
118 118
             return true;
119 119
         }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
                 continue;
196 196
             }
197 197
 
198
-            if (   $obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid)
198
+            if ($obj1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj2->guid)
199 199
                 || $obj2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $obj1->guid)) {
200 200
                 // Not-duplicate parameter found, returning zero probability
201 201
                 continue;
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/duplicates/check/person.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
             // if user's lastname is part of the email address, check to see if the difference is only in the domain part
43 43
             $email1 = preg_replace('/@.+/', '', $person1['email']);
44 44
             $email2 = preg_replace('/@.+/', '', $person2['email']);
45
-            if (   str_contains($email1, $person1['lastname'])
45
+            if (str_contains($email1, $person1['lastname'])
46 46
                 && $email1 == $email2) {
47 47
                 $p += 0.5;
48 48
             }
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/duplicates.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
     private function load_next()
61 61
     {
62
-        $i =& $this->_request_data['loop_i'];
62
+        $i = & $this->_request_data['loop_i'];
63 63
         while ($i < 100) {
64 64
             debug_add("Loop iteration {$i}");
65 65
             $qb = new midgard_query_builder('midgard_parameter');
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                 continue;
88 88
             }
89 89
             // Make sure we actually have enough rights to do this
90
-            if (   !$object1->can_do('midgard:update')
90
+            if (!$object1->can_do('midgard:update')
91 91
                 || !$object1->can_do('midgard:delete')
92 92
                 || !$object2->can_do('midgard:update')
93 93
                 || !$object2->can_do('midgard:delete')) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                 continue;
97 97
             }
98 98
             // Extra sanity check (in case of semi-successful not-duplicate mark)
99
-            if (   $object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid)
99
+            if ($object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid)
100 100
                 || $object2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object1->guid)) {
101 101
                 debug_add("It seems these two (#{$object1->id} and #{$object2->id}) have also marked as not duplicates, some cleanup might be a good thing", MIDCOM_LOG_WARN);
102 102
                 $i++;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             if ($keep == 'both') {
129 129
                 $option1->require_do('midgard:update');
130 130
                 $option2->require_do('midgard:update');
131
-                if (   $option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time())
131
+                if ($option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time())
132 132
                     && $option2->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option1->guid, time())) {
133 133
                     // Clear the possible duplicate parameters
134 134
                     $option1->delete_parameter('org.openpsa.contacts.duplicates:possible_duplicate', $option2->guid);
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
                 }
147 147
             } else {
148 148
                 if ($keep == $option1->guid) {
149
-                    $object1 =& $option1;
150
-                    $object2 =& $option2;
149
+                    $object1 = & $option1;
150
+                    $object2 = & $option2;
151 151
                 } elseif ($keep == $option2->guid) {
152
-                    $object1 =& $option2;
153
-                    $object2 =& $option1;
152
+                    $object1 = & $option2;
153
+                    $object2 = & $option1;
154 154
                 } else {
155 155
                     throw new midcom_error('Something weird happened (basically we got bogus data)');
156 156
                 }
Please login to merge, or discard this patch.
src/midcom/datamanager/schemadb.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 
65 65
             if ($path === '') {
66 66
                 // Infinite loop, set an UI message and stop executing
67
-                if (   !isset($schema['extends']['name'])
67
+                if (!isset($schema['extends']['name'])
68 68
                     || $schema['extends']['name'] === $schema_name) {
69 69
                     throw new midcom_error('schema ' . $schema_name . ' extends itself');
70 70
                 }
Please login to merge, or discard this patch.
lib/net/nehmer/blog/handler/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
     private function _process_category_constraint(org_openpsa_qbpager $qb)
77 77
     {
78
-        if (   !in_array($this->category, $this->_request_data['categories'])
78
+        if (!in_array($this->category, $this->_request_data['categories'])
79 79
             && !$this->_config->get('categories_custom_enable')) {
80 80
             throw new midcom_error('Custom categories are not allowed');
81 81
             // TODO: Check here if there are actually items in this cat?
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         midcom::get()->head->set_pagetitle($this->_request_data['page_title']);
89 89
 
90 90
         // Activate correct leaf
91
-        if (   $this->_config->get('show_navigation_pseudo_leaves')
91
+        if ($this->_config->get('show_navigation_pseudo_leaves')
92 92
             && in_array($this->category, $this->_request_data['categories'])) {
93 93
             $this->set_active_leaf($this->_topic->id . '_CAT_' . $this->category);
94 94
         }
Please login to merge, or discard this patch.
lib/net/nehmer/blog/handler/feed.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 
52 52
         if ($handler_id == 'feed-category-rss2') {
53 53
             // This is not a predefined category from configuration, check if site maintainer allows us to show it
54
-            if (   !in_array($args[0], $data['categories'])
54
+            if (!in_array($args[0], $data['categories'])
55 55
                 && !$this->_config->get('categories_custom_enable')) {
56 56
                 throw new midcom_error('Custom category support is disabled');
57 57
             }
Please login to merge, or discard this patch.