Completed
Pull Request — master (#195)
by
unknown
29:31 queued 14:30
created
lib/midcom/core/collector.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $counter = 0;
135 135
 
136 136
         foreach ($result as $object_guid => $empty_copy) {
137
-            if (    $this->_user_id
137
+            if ($this->_user_id
138 138
                 && !midcom::get()->auth->acl->can_do_byguid('midgard:read', $object_guid, $classname, $this->_user_id)) {
139 139
                 debug_add("Failed to load result, read privilege on {$object_guid} not granted for the current user.", MIDCOM_LOG_INFO);
140 140
                 continue;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                 if ($counter <= $this->_offset) {
146 146
                     continue;
147 147
                 }
148
-                if (   $this->_limit
148
+                if ($this->_limit
149 149
                     && $counter > ($this->_offset + $this->_limit)) {
150 150
                     break;
151 151
                 }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
     public function get_subkey($key, $property)
225 225
     {
226
-        if (   $this->_user_id
226
+        if ($this->_user_id
227 227
             && !midcom::get()->auth->acl->can_do_byguid('midgard:read', $key, $this->_real_class, $this->_user_id)) {
228 228
             midcom_connection::set_error(MGD_ERR_ACCESS_DENIED);
229 229
             return false;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
     public function get($key)
235 235
     {
236
-        if (   $this->_user_id
236
+        if ($this->_user_id
237 237
             && !midcom::get()->auth->acl->can_do_byguid('midgard:read', $key, $this->_real_class, $this->_user_id)) {
238 238
             midcom_connection::set_error(MGD_ERR_ACCESS_DENIED);
239 239
             return false;
Please login to merge, or discard this patch.
lib/net/nehmer/static/midcom/interfaces.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
         }
69 69
 
70 70
         $config = $this->get_config_for_topic($topic);
71
-        if (   $object->name == 'index'
71
+        if ($object->name == 'index'
72 72
             && !$config->get('autoindex')) {
73 73
             return '';
74 74
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@
 block discarded – undo
29 29
         foreach ($qb->execute() as $article) {
30 30
             try {
31 31
                 $datamanager->set_storage($article);
32
-            } catch (midcom_error $e) {
32
+            }
33
+            catch (midcom_error $e) {
33 34
                 $e->log(MIDCOM_LOG_WARN);
34 35
                 continue;
35 36
             }
Please login to merge, or discard this patch.
lib/net/nemein/tag/handler.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -384,7 +384,8 @@  discard block
 block discarded – undo
384 384
                 $value = $link->value;
385 385
 
386 386
                 $tags[$key] = $value;
387
-            } catch (midcom_error $e) {
387
+            }
388
+            catch (midcom_error $e) {
388 389
                 $e->log();
389 390
             }
390 391
         }
@@ -443,7 +444,8 @@  discard block
 block discarded – undo
443 444
             try {
444 445
                 $tag = net_nemein_tag_tag_dba::get_cached($link->tag);
445 446
                 $link_object_map[$link->fromGuid][$tag->tag] = $link;
446
-            } catch (midcom_error $e) {
447
+            }
448
+            catch (midcom_error $e) {
447 449
                 $e->log();
448 450
             }
449 451
         }
@@ -472,7 +474,8 @@  discard block
 block discarded – undo
472 474
                     $tmpobject = midcom::get()->dbfactory->convert_midgard_to_midcom($tmpobject);
473 475
                 }
474 476
                 $return[] = $tmpobject;
475
-            } catch (midcom_error $e) {
477
+            }
478
+            catch (midcom_error $e) {
476 479
                 $e->log();
477 480
             }
478 481
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function copy_tags($from, $to)
186 186
     {
187
-        if (   !is_object($from)
187
+        if (!is_object($from)
188 188
             || !is_object($to)) {
189 189
             return false;
190 190
         }
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
         $strlen = strlen($tags_string);
489 489
         for ($i = 0; $i < $strlen; $i++) {
490 490
             $char = $tags_string[$i];
491
-            if (   (   $char == ' '
491
+            if (($char == ' '
492 492
                     && !$quote_open)
493 493
                 || $i == $strlen) {
494 494
                 $tags[] = $current_tag;
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
                 $quote_open = false;
500 500
                 continue;
501 501
             }
502
-            if (   $char === '"'
502
+            if ($char === '"'
503 503
                 || $char === "'") {
504 504
                 $quote_open = $char;
505 505
                 continue;
Please login to merge, or discard this patch.
lib/net/nemein/tag/tag.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function _on_creating()
44 44
     {
45
-        return (   $this->validate_tag($this->tag)
45
+        return ($this->validate_tag($this->tag)
46 46
                 && $this->_check_duplicates() == 0);
47 47
     }
48 48
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             midcom::get()->uimessages->add(midcom::get()->i18n->get_string('net.nemein.tag', 'net.nemein.tag'), sprintf(midcom::get()->i18n->get_string('tag "%s" is not valid. tags may not be numeric', 'net.nemein.tag'), $tag), 'info');
67 67
             return false;
68 68
         }
69
-        if (   strstr($tag, '"')
69
+        if (strstr($tag, '"')
70 70
             || strstr($tag, "'")) {
71 71
             midcom::get()->uimessages->add(midcom::get()->i18n->get_string('net.nemein.tag', 'net.nemein.tag'), sprintf(midcom::get()->i18n->get_string('tag "%s" is not valid. tags may not contain quotes', 'net.nemein.tag'), $tag), 'info');
72 72
             return false;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
     public function _on_updating()
79 79
     {
80
-        return (   $this->validate_tag($this->tag)
80
+        return ($this->validate_tag($this->tag)
81 81
                 && $this->_check_duplicates() == 0);
82 82
     }
83 83
 
Please login to merge, or discard this patch.
lib/net/nemein/tag/exec/merge.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 <h1>Merge tags</h1>
5 5
 
6 6
 <?php
7
-if (   isset($_POST['from'])
7
+if (isset($_POST['from'])
8 8
     && isset($_POST['to'])) {
9 9
     if (net_nemein_tag_handler::merge_tags($_POST['from'], $_POST['to'])) {
10 10
         echo "<p>Successfully merged tag \"{$_POST['from']}\" to \"{$_POST['to']}\"</p>\n";
Please login to merge, or discard this patch.
lib/net/nemein/redirector/viewer.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,8 @@
 block discarded – undo
152 152
                     try {
153 153
                         $topic = new midcom_db_topic($id);
154 154
                         $id = $topic->id;
155
-                    } catch (midcom_error $e) {
155
+                    }
156
+                    catch (midcom_error $e) {
156 157
                         $e->log();
157 158
                         break;
158 159
                     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@
 block discarded – undo
19 19
     public function _on_initialize()
20 20
     {
21 21
         // Match /
22
-        if (   $this->_config->get('redirection_type') === null
23
-            || (   $this->_topic->can_do('net.nemein.redirector:noredirect')
22
+        if ($this->_config->get('redirection_type') === null
23
+            || ($this->_topic->can_do('net.nemein.redirector:noredirect')
24 24
                 && !$this->_config->get('admin_redirection'))) {
25 25
             $this->_request_switch['redirect'] = [
26 26
                 'handler' => [net_nemein_redirector_handler_tinyurl::class, 'list'],
Please login to merge, or discard this patch.
lib/net/nemein/wiki/midcom/interfaces.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 
42 42
     public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object)
43 43
     {
44
-        if (   $object instanceof midcom_db_article
44
+        if ($object instanceof midcom_db_article
45 45
             && $topic->id == $object->topic) {
46 46
             if ($object->name == 'index') {
47 47
                 return '';
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,8 @@
 block discarded – undo
30 30
             foreach ($result as $wikipage) {
31 31
                 try {
32 32
                     $datamanager->set_storage($wikipage);
33
-                } catch (midcom_error $e) {
33
+                }
34
+                catch (midcom_error $e) {
34 35
                     $e->log(MIDCOM_LOG_WARN);
35 36
                     continue;
36 37
                 }
Please login to merge, or discard this patch.
lib/net/nemein/wiki/handler/feed.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,8 @@
 block discarded – undo
66 66
             try {
67 67
                 $author = new midcom_db_person($wikipage->metadata->revisor);
68 68
                 $item->author = $author->name;
69
-            } catch (midcom_error $e) {
69
+            }
70
+            catch (midcom_error $e) {
70 71
                 $e->log();
71 72
             }
72 73
 
Please login to merge, or discard this patch.
lib/net/nemein/wiki/handler/latest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                     return;
51 51
                 }
52 52
 
53
-                if (   $history['date'] < $from
53
+                if ($history['date'] < $from
54 54
                     || $history['date'] > $to) {
55 55
                     // We can ignore revisions outside the timeframe
56 56
                     continue;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $this->_seek_updated($from);
94 94
 
95 95
         $i = 0;
96
-        while (   $this->_updated_pages < $this->_max_pages
96
+        while ($this->_updated_pages < $this->_max_pages
97 97
                && $i < 20) {
98 98
             // Expand seek by another two weeks
99 99
             $to = $from;
Please login to merge, or discard this patch.