Passed
Push — master ( 87de88...fdfb7f )
by Andreas
11:09
created
lib/net/nehmer/comments/handler/view.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
         if (!$this->_schemadb) {
99 99
             $this->_schemadb = schemadb::from_path($this->_config->get('schemadb'));
100 100
 
101
-            if (   $this->_config->get('use_captcha')
102
-                || (   !midcom::get()->auth->user
101
+            if ($this->_config->get('use_captcha')
102
+                || (!midcom::get()->auth->user
103 103
                     && $this->_config->get('use_captcha_if_anonymous'))) {
104 104
                 $fields = $this->_schemadb->get('comment')->get('fields');
105 105
                 $fields['captcha'] = [
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                 $this->_schemadb->get('comment')->set('fields', $fields);
113 113
             }
114 114
 
115
-            if (   $this->_config->get('ratings_enable')
115
+            if ($this->_config->get('ratings_enable')
116 116
                 && $this->_schemadb->get('comment')->has_field('rating')) {
117 117
                 $this->_schemadb->get('comment')->get_field('rating')['hidden'] = false;
118 118
             }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
             $this->_comments = $this->_comments->execute();
192 192
         }
193 193
 
194
-        if (   midcom::get()->auth->user
194
+        if (midcom::get()->auth->user
195 195
             || $this->_config->get('allow_anonymous')) {
196 196
             $this->_init_post_controller($request);
197 197
             if ($response = $this->_process_post($request)) {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      */
223 223
     private function _process_post(Request $request)
224 224
     {
225
-        if (   !midcom::get()->auth->user
225
+        if (!midcom::get()->auth->user
226 226
             && !midcom::get()->auth->request_sudo('net.nehmer.comments')) {
227 227
             throw new midcom_error('We were anonymous but could not acquire SUDO privileges, aborting');
228 228
         }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                 }
236 236
 
237 237
                 $formdata = $this->_post_controller->get_form_values();
238
-                if (   $formdata['subscribe']
238
+                if ($formdata['subscribe']
239 239
                     && midcom::get()->auth->user) {
240 240
                     // User wants to subscribe to receive notifications about this comments thread
241 241
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
      */
270 270
     private function _get_last_modified() : int
271 271
     {
272
-        return array_reduce($this->_comments, function ($carry, net_nehmer_comments_comment $item) {
272
+        return array_reduce($this->_comments, function($carry, net_nehmer_comments_comment $item) {
273 273
             return max($item->metadata->revised, $carry);
274 274
         }, 0);
275 275
     }
@@ -291,8 +291,8 @@  discard block
 block discarded – undo
291 291
                 $data['comment_toolbar'] = $this->populate_post_toolbar($comment);
292 292
                 midcom_show_style('comments-item');
293 293
 
294
-                if (   midcom::get()->auth->admin
295
-                    || (   midcom::get()->auth->user
294
+                if (midcom::get()->auth->admin
295
+                    || (midcom::get()->auth->user
296 296
                         && $comment->can_do('midgard:delete'))) {
297 297
                     midcom_show_style('comments-admintoolbar');
298 298
                 }
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
             midcom_show_style('comments-nonefound');
303 303
         }
304 304
 
305
-        if (   midcom::get()->auth->user
305
+        if (midcom::get()->auth->user
306 306
             || $this->_config->get('allow_anonymous')) {
307 307
             midcom_show_style('post-comment');
308 308
         } else {
Please login to merge, or discard this patch.
lib/midcom/services/auth/acl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -568,10 +568,10 @@
 block discarded – undo
568 568
         }
569 569
 
570 570
         //owner privileges override everything but person privileges, so we have to cross-check those here
571
-        if (   $privilegename != 'midgard:owner'
571
+        if ($privilegename != 'midgard:owner'
572 572
             && $last_scope < MIDCOM_PRIVILEGE_SCOPE_OWNER) {
573 573
             $owner_privileges = $this->get_owner_default_privileges();
574
-            if (    array_key_exists($privilegename, $owner_privileges)
574
+            if (array_key_exists($privilegename, $owner_privileges)
575 575
                  && $this->_load_content_privilege('midgard:owner', $guid, $class, $user_id)
576 576
                  && self::$_content_privileges_cache[$cache_id]['midgard:owner']) {
577 577
                 self::$_content_privileges_cache[$cache_id][$privilegename] = ($owner_privileges[$privilegename] == MIDCOM_PRIVILEGE_ALLOW);
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/type/captchaType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
     public function buildForm(FormBuilderInterface $builder, array $options)
44 44
     {
45 45
         $session_key = md5($builder->getForm()->getName() . '_session_key');
46
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($session_key) {
46
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($session_key) {
47 47
             $value = $event->getForm()->getData();
48 48
             $session = new midcom_services_session('midcom_datamanager_captcha');
49 49
 
50
-            if (   !$session->exists($session_key)
50
+            if (!$session->exists($session_key)
51 51
                 || $value != $session->get($session_key)) {
52 52
                 $event->getForm()->addError(new FormError($this->l10n->get('captcha validation failed')));
53 53
             }
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/formExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
         $view->vars['readonly'] = $options['readonly'];
66 66
 
67 67
         if ($options['write_privilege'] !== null) {
68
-            if (   array_key_exists('group', $options['write_privilege'])
68
+            if (array_key_exists('group', $options['write_privilege'])
69 69
                 && !$this->auth->is_group_member($options['write_privilege']['group'])) {
70 70
                 $view->vars['readonly'] = true;
71 71
             }
Please login to merge, or discard this patch.
lib/midcom/services/rcs/backend/rcs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
                 $revisions[$history['revision']] = $history;
92 92
 
93 93
                 $i += 3;
94
-                while (   $i < $total
94
+                while ($i < $total
95 95
                         && !str_starts_with($lines[$i], '----')
96 96
                         && !str_starts_with($lines[$i], '=====')) {
97 97
                     $i++;
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/search.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
 
83 83
         // Handle automatic wildcards
84 84
         $auto_wildcards = $this->_config->get('auto_wildcards');
85
-        if (   $auto_wildcards
85
+        if ($auto_wildcards
86 86
             && !str_contains($this->_query_string_processed, '%')) {
87 87
             switch ($auto_wildcards) {
88 88
                 case 'both':
Please login to merge, or discard this patch.
lib/org/openpsa/directmarketing/support/bounce_detector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 $recipient = $_ENV["RECIPIENT"];
47 47
 $token_length = strlen($recipient) - strlen($prefix) - strlen($suffix);
48
-if (   $token_length <= 0
48
+if ($token_length <= 0
49 49
     || !str_starts_with($recipient, $prefix)
50 50
     || !str_ends_with($recipient, $suffix)) {
51 51
     error_log("Recipient address does not match address template: $recipient");
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         fclose($fh);
62 62
         exit(0);
63 63
     }
64
-} elseif (   str_starts_with($BOUNCE_LOGGER, "http://")
64
+} elseif (str_starts_with($BOUNCE_LOGGER, "http://")
65 65
           || str_starts_with($BOUNCE_LOGGER, "https://")) {
66 66
     $client = new org_openpsa_httplib();
67 67
     $client->post($BOUNCE_LOGGER, ["token" => $token]);
Please login to merge, or discard this patch.
src/midcom/routing/parser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $url = $this->context->get_key(MIDCOM_CONTEXT_URI);
47 47
 
48 48
         $prefix_length = strlen(midcom_connection::get_url('prefix'));
49
-        if (   $prefix_length > 1
49
+        if ($prefix_length > 1
50 50
             && str_starts_with($url, midcom_connection::get_url('prefix'))) {
51 51
             $url = substr($url, $prefix_length);
52 52
         }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function find_urlmethod() : ?string
73 73
     {
74
-        if (   empty($this->argv)
74
+        if (empty($this->argv)
75 75
             || !str_starts_with($this->argv[0], 'midcom-')) {
76 76
             return null;
77 77
         }
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/transformer/imageTransformer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
         }
48 48
 
49 49
         $result = [];
50
-        if (   !empty($array['file'])
50
+        if (!empty($array['file'])
51 51
             || !empty($array['identifier']) && str_starts_with($array['identifier'], 'tmpfile-')) {
52 52
             $result['file'] = parent::reverseTransform($array);
53 53
         } elseif (!empty($array['objects'])) {
Please login to merge, or discard this patch.