Passed
Push — master ( 3c7506...404c28 )
by Andreas
26:22
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/net/nehmer/comments/handler/moderate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         $message['content'] = '';
55 55
         $logs = $comment->get_logs();
56 56
         if (!empty($logs)) {
57
-            $message['content'] .= $this->_l10n->get('moderation history').":\n\n";
57
+            $message['content'] .= $this->_l10n->get('moderation history') . ":\n\n";
58 58
             foreach ($logs as $time => $log) {
59 59
                 $reported = $this->_l10n->get_formatter()->datetime(strtotime("{$time}Z"));
60 60
                 $message['content'] .= $this->_l10n->get(sprintf('%s: %s by %s (from %s)', "$reported:\n", $this->_l10n->get($log['action']), $log['reporter'], $log['ip'])) . "\n\n";
Please login to merge, or discard this patch.
lib/org/openpsa/directmarketing/importer/csv.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@
 block discarded – undo
55 55
         foreach (array_filter($csv_line) as $field => $value) {
56 56
             // Process the row accordingly
57 57
             $field_matching = $this->_settings['fields'][$field];
58
-            if (   $field_matching
58
+            if ($field_matching
59 59
                 && strstr($field_matching, ':')) {
60 60
                 [$schemadb, $schema_field] = explode(':', $field_matching);
61 61
 
62
-                if (   !array_key_exists($schemadb, $this->_schemadbs)
62
+                if (!array_key_exists($schemadb, $this->_schemadbs)
63 63
                     || !$this->_schemadbs[$schemadb]->get('default')->has_field($schema_field)) {
64 64
                     // Invalid matching, skip
65 65
                     continue;
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/midcom/response/relocate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      */
28 28
     public function setTargetUrl($url)
29 29
     {
30
-        if (   !str_starts_with($url, "/")
30
+        if (!str_starts_with($url, "/")
31 31
             && !preg_match('|^https?://|', $url)) {
32 32
             $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX);
33 33
             if ($prefix == '') {
Please login to merge, or discard this patch.
lib/midcom/config/main.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
         // show_unapproved_objects). Disabled by default. Unsafe to Link Prefetching!
428 428
         'metadata_approval' => false,
429 429
         'metadata_scheduling' => false,
430
-        'metadata_lock_timeout' => 60,    // Time in minutes
430
+        'metadata_lock_timeout' => 60, // Time in minutes
431 431
         'staging2live_staging' => false,
432 432
 
433 433
         // Set the datamanager schema used by the Metadata Service
@@ -518,12 +518,12 @@  discard block
 block discarded – undo
518 518
             return $default;
519 519
         }
520 520
 
521
-        if (   $key === 'auth_type'
521
+        if ($key === 'auth_type'
522 522
             && !in_array($this->_merged_config[$key], ['Plaintext', 'Legacy', 'SHA256'])) {
523 523
             throw new midcom_error('Unsupported authentication type');
524 524
         }
525 525
         // Check the midcom_config site prefix for absolute local urls
526
-        if (   $key === 'midcom_site_url'
526
+        if ($key === 'midcom_site_url'
527 527
             && str_starts_with($this->_merged_config[$key], '/')) {
528 528
             $this->_merged_config[$key] = midcom::get()->get_page_prefix() . substr($this->_merged_config[$key], 1);
529 529
         }
Please login to merge, or discard this patch.