Completed
Pull Request — master (#198)
by
unknown
19:02
created
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.
lib/net/nemein/wiki/wikipage.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
     public function _on_creating()
31 31
     {
32
-        if (   $this->title == ''
32
+        if ($this->title == ''
33 33
             || !$this->topic) {
34 34
             // We must have wikiword and topic at this stage
35 35
             return false;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -193,7 +193,8 @@
 block discarded – undo
193 193
 
194 194
         try {
195 195
             $diff_fields = $rcs_handler->get_diff($prev_version, $this_version);
196
-        } catch (midcom_error $e) {
196
+        }
197
+        catch (midcom_error $e) {
197 198
             $e->log();
198 199
             return '';
199 200
         }
Please login to merge, or discard this patch.
lib/net/nemein/rss/parser/item.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     public function get_link($key = 0, $rel = 'alternate')
62 62
     {
63 63
         $link = parent::get_link($key, $rel);
64
-        if (   $rel !== 'alternate'
64
+        if ($rel !== 'alternate'
65 65
             || $key !== 0) {
66 66
             return $link;
67 67
         }
Please login to merge, or discard this patch.
lib/net/nehmer/comments/comment.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -408,7 +408,8 @@
 block discarded – undo
408 408
         //Get the parent object
409 409
         try {
410 410
             $parent = midcom::get()->dbfactory->get_object_by_guid($this->objectguid);
411
-        } catch (midcom_error $e) {
411
+        }
412
+        catch (midcom_error $e) {
412 413
             $e->log();
413 414
             return false;
414 415
         }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         }
186 186
 
187 187
         // Set the status
188
-        if (   $this->can_do('net.nehmer.comments:moderation')
188
+        if ($this->can_do('net.nehmer.comments:moderation')
189 189
             && !$this->_sudo_requested) {
190 190
             $this->status = self::ABUSE;
191 191
         } else {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             return false;
210 210
         }
211 211
         // Set the status
212
-        if (   !$this->can_do('net.nehmer.comments:moderation')
212
+        if (!$this->can_do('net.nehmer.comments:moderation')
213 213
             || $this->_sudo_requested) {
214 214
             return false;
215 215
         }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         }
234 234
 
235 235
         // Set the status
236
-        if (   !$this->can_do('net.nehmer.comments:moderation')
236
+        if (!$this->can_do('net.nehmer.comments:moderation')
237 237
             || $this->_sudo_requested) {
238 238
             return false;
239 239
         }
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
      */
253 253
     public function report_not_abuse()
254 254
     {
255
-        if (   !$this->can_do('net.nehmer.comments:moderation')
255
+        if (!$this->can_do('net.nehmer.comments:moderation')
256 256
             || $this->_sudo_requested) {
257 257
             return false;
258 258
         }
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
     {
352 352
         $config = midcom_baseclasses_components_configuration::get('net.nehmer.comments', 'config');
353 353
 
354
-        if (   $config->get('ratings_enable')
355
-            && (    $config->get('ratings_cache_to_object')
354
+        if ($config->get('ratings_enable')
355
+            && ($config->get('ratings_cache_to_object')
356 356
                  || $config->get('comment_count_cache_to_object'))) {
357 357
             // Handle ratings
358 358
             $comments = self::list_by_objectguid($this->objectguid);
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
             return false;
410 410
         }
411 411
 
412
-        if (   empty($this->title)
412
+        if (empty($this->title)
413 413
             && empty($this->content)) {
414 414
             // No need to send notifications about empty rating entries
415 415
             return false;
Please login to merge, or discard this patch.