Passed
Branch master (7a7694)
by Andreas
18:25
created
lib/org/openpsa/contacts/handler/duplicates/person.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,8 @@  discard block
 block discarded – undo
66 66
             try {
67 67
                 $person1 = new org_openpsa_contacts_person_dba($param->parentguid);
68 68
                 $person2 = new org_openpsa_contacts_person_dba($param->name);
69
-            } catch (midcom_error $e) {
69
+            }
70
+            catch (midcom_error $e) {
70 71
                 $i++;
71 72
                 continue;
72 73
             }
@@ -137,7 +138,8 @@  discard block
 block discarded – undo
137 138
                 try {
138 139
                     $merger = new org_openpsa_contacts_duplicates_merge('person', $this->_config);
139 140
                     $merger->merge_delete($person1, $person2);
140
-                } catch (midcom_error $e) {
141
+                }
142
+                catch (midcom_error $e) {
141 143
                     // TODO: Localize
142 144
                     midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.contacts'), 'Merge failed, errstr: ' . $e->getMessage(), 'error');
143 145
                 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
     private function load_next()
43 43
     {
44
-        $i =& $this->_request_data['loop_i'];
44
+        $i = & $this->_request_data['loop_i'];
45 45
         while ($i < 100) {
46 46
             debug_add("Loop iteration {$i}");
47 47
             $qb = new midgard_query_builder('midgard_parameter');
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                 continue;
70 70
             }
71 71
             // Make sure we actually have enough rights to do this
72
-            if (   !$person1->can_do('midgard:update')
72
+            if (!$person1->can_do('midgard:update')
73 73
                 || !$person1->can_do('midgard:delete')
74 74
                 || !$person2->can_do('midgard:update')
75 75
                 || !$person2->can_do('midgard:delete')) {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                 continue;
79 79
             }
80 80
             // Extra sanity check (in case of semi-successful not-duplicate mark)
81
-            if (   $person1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $person2->guid)
81
+            if ($person1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $person2->guid)
82 82
                 || $person2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $person1->guid)) {
83 83
                 debug_add("It seems these two (#{$person1->id} and #{$person2->id}) have also marked as not duplicates, some cleanup might be a good thing", MIDCOM_LOG_WARN);
84 84
                 $i++;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             if ($keep == 'both') {
103 103
                 $option1->require_do('midgard:update');
104 104
                 $option2->require_do('midgard:update');
105
-                if (   $option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time())
105
+                if ($option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time())
106 106
                     && $option2->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option1->guid, time())) {
107 107
                     // Clear the possible duplicate parameters
108 108
                     $option1->delete_parameter('org.openpsa.contacts.duplicates:possible_duplicate', $option2->guid);
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
                 }
121 121
             } else {
122 122
                 if ($keep == $option1->guid) {
123
-                    $person1 =& $option1;
124
-                    $person2 =& $option2;
123
+                    $person1 = & $option1;
124
+                    $person2 = & $option2;
125 125
                 } elseif ($keep == $option2->guid) {
126
-                    $person1 =& $option2;
127
-                    $person2 =& $option1;
126
+                    $person1 = & $option2;
127
+                    $person2 = & $option1;
128 128
                 } else {
129 129
                     throw new midcom_error('Something weird happened (basically we got bogus data)');
130 130
                 }
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/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/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/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/midcom/helper/nav/main.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -296,7 +296,8 @@
 block discarded – undo
296 296
         // the tree. This is, for example, used by the on-delete cache invalidation.
297 297
         try {
298 298
             $object = midcom::get()->dbfactory->get_object_by_guid($guid);
299
-        } catch (midcom_error $e) {
299
+        }
300
+        catch (midcom_error $e) {
300 301
             debug_add("Could not load GUID {$guid}, trying to continue anyway. Last error was: " . $e->getMessage(), MIDCOM_LOG_WARN);
301 302
         }
302 303
         if (!empty($object)) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                     $entry = "<span class=\"{$current_class}\">{$entry}</span>";
423 423
                 }
424 424
             } else {
425
-                if (   !empty($data['napobject'][MIDCOM_NAV_GUID])
425
+                if (!empty($data['napobject'][MIDCOM_NAV_GUID])
426 426
                     && in_array($data['napobject'][MIDCOM_NAV_GUID], $skip_guids)) {
427 427
                     continue;
428 428
                 }
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
                     $id = "custom-{$key}";
538 538
 
539 539
                     $url = "{$prefix}{$entry[MIDCOM_NAV_URL]}";
540
-                    if (   str_starts_with($entry[MIDCOM_NAV_URL], '/')
540
+                    if (str_starts_with($entry[MIDCOM_NAV_URL], '/')
541 541
                         || preg_match('|^https?://|', $entry[MIDCOM_NAV_URL])) {
542 542
                         $url = $entry[MIDCOM_NAV_URL];
543 543
                     }
Please login to merge, or discard this patch.