Test Failed
Branch master (8d1702)
by Andreas
11:03
created
lib/midcom/services/indexer/document/attachment.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
     private function process_attachment()
95 95
     {
96
-        if (   !isset($this->attachment->metadata)
96
+        if (!isset($this->attachment->metadata)
97 97
             || !is_object($this->attachment->metadata)) {
98 98
             return;
99 99
         }
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
         }
143 143
 
144 144
         if (strlen(trim($this->attachment->title)) > 0) {
145
-            $this->title =  "{$this->attachment->title} ({$this->attachment->name})";
145
+            $this->title = "{$this->attachment->title} ({$this->attachment->name})";
146 146
             $this->content .= "\n{$this->attachment->title}\n{$this->attachment->name}";
147 147
         } else {
148
-            $this->title =  $this->attachment->name;
148
+            $this->title = $this->attachment->name;
149 149
             $this->content .= "\n{$this->attachment->name}";
150 150
         }
151 151
 
Please login to merge, or discard this patch.
lib/midcom/services/auth/frontend/form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function read_authentication_data()
26 26
     {
27
-        if (   !array_key_exists('midcom_services_auth_frontend_form_submit', $_REQUEST)
27
+        if (!array_key_exists('midcom_services_auth_frontend_form_submit', $_REQUEST)
28 28
             || !array_key_exists('username', $_REQUEST)
29 29
             || !array_key_exists('password', $_REQUEST)) {
30 30
             return null;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         // Store the submitted form if the session expired, but user wants to save the data
54 54
         if (count($_POST) > 0) {
55
-            $data =& midcom_core_context::get()->get_custom_key('request_data');
55
+            $data = & midcom_core_context::get()->get_custom_key('request_data');
56 56
 
57 57
             $data['restored_form_data'] = array();
58 58
 
Please login to merge, or discard this patch.
lib/midcom/services/auth/sessionmgr.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             $clientip = $_SERVER['REMOTE_ADDR'];
193 193
         }
194 194
 
195
-        if (   midcom::get()->config->get('auth_check_client_ip')
195
+        if (midcom::get()->config->get('auth_check_client_ip')
196 196
             && $session->clientip != $clientip) {
197 197
             debug_add("The session {$session->guid} (#{$session->id}) had mismatching client IP.", MIDCOM_LOG_INFO);
198 198
             debug_add("Expected {$session->clientip}, got {$clientip}.");
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     private function _load_person()
255 255
     {
256 256
         if (!$this->user) {
257
-            debug_add("Failed to authenticate the given user: ". midcom_connection::get_error_string(),
257
+            debug_add("Failed to authenticate the given user: " . midcom_connection::get_error_string(),
258 258
             MIDCOM_LOG_INFO);
259 259
             return false;
260 260
         }
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
         $result = array();
441 441
         $query_result = array_keys($mc->list_keys());
442 442
         foreach ($query_result as $userid) {
443
-            if (   ($user = $this->auth->get_user($userid))
443
+            if (($user = $this->auth->get_user($userid))
444 444
                 && $user->is_online()) {
445 445
                 $result[$user->guid] = $user;
446 446
             }
Please login to merge, or discard this patch.
lib/net/nemein/redirector/viewer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
     public function _on_initialize()
20 20
     {
21 21
         // Match /
22
-        if (   is_null($this->_config->get('redirection_type'))
23
-            || (   $this->_topic->can_do('net.nemein.redirector:noredirect')
22
+        if (is_null($this->_config->get('redirection_type'))
23
+            || ($this->_topic->can_do('net.nemein.redirector:noredirect')
24 24
                 && !$this->_config->get('admin_redirection'))) {
25 25
             $this->_request_switch['redirect'] = array(
26 26
                 'handler' => array('net_nemein_redirector_handler_tinyurl', 'list'),
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
             // Catch first the configuration option for showing editing interface instead
79 79
             // of redirecting administrators
80
-            if (   $this->_topic->can_do('net.nemein.redirector:noredirect')
80
+            if ($this->_topic->can_do('net.nemein.redirector:noredirect')
81 81
                 && !$this->_config->get('admin_redirection')) {
82 82
                 midcom::get()->relocate("{$this->_topic->name}/edit/{$args[0]}/");
83 83
             }
Please login to merge, or discard this patch.
lib/net/nemein/wiki/resolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
          that is populated only once, and even then only the
131 131
          first time we encounter a namespaced wikilink */
132 132
         static $folder_tree = array();
133
-        if (   count($folder_tree) == 0
133
+        if (count($folder_tree) == 0
134 134
             || $force_resolve_folder_tree) {
135 135
             $folder_tree = $this->_resolve_folder_tree($force_as_root);
136 136
         }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             $localpath = $path;
161 161
             $matches['latest_parent'] = $folder_tree['/'];
162 162
             $missing_levels = 0;
163
-            while (   $localpath
163
+            while ($localpath
164 164
                    && $localpath != '/') {
165 165
                 $localpath = dirname($localpath);
166 166
                 $missing_levels++;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
         $root_folder = $folder;
189 189
         $max = 100;
190
-        while (   $folder[MIDCOM_NAV_COMPONENT] == 'net.nemein.wiki'
190
+        while ($folder[MIDCOM_NAV_COMPONENT] == 'net.nemein.wiki'
191 191
                && (($parent = $nap->get_node_uplink($folder[MIDCOM_NAV_ID])) != -1)
192 192
                && $max > 0) {
193 193
             $root_folder = $folder;
Please login to merge, or discard this patch.
lib/net/nemein/wiki/parser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                 return $this->render_link($parts[1], $parts[2]) . $after;
225 225
 
226 226
             // Macro [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>])
227
-            case (   preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
227
+            case (preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
228 228
                   && method_exists($this, "_run_macro_{$macro_parts[1]}")):
229 229
                 $method = "_run_macro_{$macro_parts[1]}";
230 230
                 return $this->$method($macro_parts[2], $match[0], $after);
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                 $folder = $wikipage_match['latest_parent'];
258 258
             }
259 259
 
260
-            if (   isset($folder[MIDCOM_NAV_OBJECT])
260
+            if (isset($folder[MIDCOM_NAV_OBJECT])
261 261
                 && $folder[MIDCOM_NAV_OBJECT]->can_do('midgard:create')) {
262 262
                 $workflow = $this->get_workflow('datamanager2');
263 263
                 return "<a href=\"{$folder[MIDCOM_NAV_ABSOLUTEURL]}create/?wikiword={$wikipage_match['remaining_path']}\" " . $workflow->render_attributes() . " class=\"wiki_missing\" title=\"" . $this->_l10n->get('click to create') . "\">{$text}</a>";
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
                     $links[$parts[1]] = $parts[2];
301 301
                     break;
302 302
                 // Ignore macros [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>])
303
-                case (   preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
303
+                case (preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
304 304
                       && method_exists($this, "_run_macro_{$macro_parts[1]}")):
305 305
                     continue 2;
306 306
 
Please login to merge, or discard this patch.
lib/net/nemein/wiki/handler/create.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
 
66 66
         if (!$this->_page->create()) {
67 67
             debug_print_r('We operated on this object:', $this->_page);
68
-            throw new midcom_error('Failed to create a new page. Last Midgard error was: '. midcom_connection::get_error_string());
68
+            throw new midcom_error('Failed to create a new page. Last Midgard error was: ' . midcom_connection::get_error_string());
69 69
         }
70 70
 
71 71
         return $this->_page;
Please login to merge, or discard this patch.
lib/net/nemein/wiki/handler/view.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     public function __construct()
38 38
     {
39
-        $this->_request_data['page'] =& $this->_page;
39
+        $this->_request_data['page'] = & $this->_page;
40 40
     }
41 41
 
42 42
     /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         if (midcom::get()->config->get('enable_ajax_editing')) {
48 48
             $this->_controller = midcom_helper_datamanager2_controller::create('ajax');
49
-            $this->_controller->schemadb =& $this->_request_data['schemadb'];
49
+            $this->_controller->schemadb = & $this->_request_data['schemadb'];
50 50
             $this->_controller->set_storage($this->_page);
51 51
             $this->_controller->process_ajax();
52 52
             $this->_datamanager = $this->_controller->datamanager;
@@ -272,9 +272,9 @@  discard block
 block discarded – undo
272 272
         $toc .= "\n<ol class=\"midcom_helper_toc_formatter level_{$current_list_level}\">\n";
273 273
         foreach ($headings[4] as $key => $heading) {
274 274
             $anchor = 'heading-' . md5($heading);
275
-            $tag_level =& $headings[3][$key];
276
-            $heading_code =& $headings[0][$key];
277
-            $heading_tag =& $headings[2][$key];
275
+            $tag_level = & $headings[3][$key];
276
+            $heading_code = & $headings[0][$key];
277
+            $heading_tag = & $headings[2][$key];
278 278
             $heading_new_code = "<a id='{$anchor}'></a>{$heading_code}";
279 279
             $content = str_replace($heading_code, $heading_new_code, $content);
280 280
             if ($current_tag_level === false) {
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
                     }
301 301
                 }
302 302
             }
303
-            $toc .= "<li class='{$heading_tag}'><a href='#{$anchor}'>" . strip_tags($heading) .  "</a>";
303
+            $toc .= "<li class='{$heading_tag}'><a href='#{$anchor}'>" . strip_tags($heading) . "</a>";
304 304
         }
305 305
         for ($i = $current_list_level; $i > 0; $i--) {
306 306
             $toc .= "</li>\n</ol>\n";
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 
368 368
         $user = midcom::get()->auth->user->get_storage();
369 369
 
370
-        if (   array_key_exists('target', $_POST)
370
+        if (array_key_exists('target', $_POST)
371 371
             && $_POST['target'] == 'folder') {
372 372
             // We're subscribing to the whole wiki
373 373
             $object = $this->_topic;
Please login to merge, or discard this patch.
lib/net/nemein/rss/fetch.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             $etag = trim($parser->data['headers']['etag']);
102 102
 
103 103
             $feed_etag = $this->_feed->get_parameter('net.nemein.rss', 'etag');
104
-            if (   !empty($feed_etag)
104
+            if (!empty($feed_etag)
105 105
                 && $feed_etag == $etag) {
106 106
                 // Feed hasn't changed, skip updating
107 107
                 debug_add("Feed {$this->_feed->url} has not changed since " . date('c', $this->_feed->latestfetch), MIDCOM_LOG_WARN);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         $guid = $item->get_id();
188 188
         $title = $item->get_title();
189 189
 
190
-        if (   (   empty($title)
190
+        if ((empty($title)
191 191
                 || trim($title) == '...')
192 192
             && empty($guid)) {
193 193
             // Something wrong with this entry, skip it
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
                 $meta_values['published'] = $article_date;
256 256
             }
257 257
 
258
-            if (   $this->apply_values($article, $values, $meta_values)
258
+            if ($this->apply_values($article, $values, $meta_values)
259 259
                 && !$article->update()) {
260 260
                 return false;
261 261
             }
@@ -284,14 +284,14 @@  discard block
 block discarded – undo
284 284
     private function find_author(net_nemein_rss_parser_item $item)
285 285
     {
286 286
         // Try to figure out item author
287
-        if (   $this->_feed->forceauthor
287
+        if ($this->_feed->forceauthor
288 288
             && $this->_feed->defaultauthor) {
289 289
             // Feed has a "default author" set, use it
290 290
             return new midcom_db_person($this->_feed->defaultauthor);
291 291
         }
292 292
         $author = $this->match_item_author($item);
293 293
         $fallback_person_id = 1;
294
-        if (   !$author
294
+        if (!$author
295 295
             || $author->id == $fallback_person_id) {
296 296
             if ($this->_feed->defaultauthor) {
297 297
                 // Feed has a "default author" set, use it
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
             }
478 478
         }
479 479
 
480
-        if (   !empty($author_info['username'])
480
+        if (!empty($author_info['username'])
481 481
             && $person = midcom::get()->auth->get_user_by_name($author_info['username'])) {
482 482
             return $person->get_storage();
483 483
         }
Please login to merge, or discard this patch.