Test Setup Failed
Pull Request — master (#190)
by
unknown
09:58
created
lib/org/openpsa/calendar/event.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
     public function get_parent_guid_uncached()
83 83
     {
84
-        if (   $this->up
84
+        if ($this->up
85 85
             || $this->title != '__org_openpsa_calendar') {
86 86
             $root_event = org_openpsa_calendar_interface::find_root_event();
87 87
             if ($this->id != $root_event->id) {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         }
142 142
 
143 143
         //Check up
144
-        if (   !$this->up
144
+        if (!$this->up
145 145
             && $this->title != '__org_openpsa_calendar') {
146 146
             $root_event = org_openpsa_calendar_interface::find_root_event();
147 147
             $this->up = $root_event->id;
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
     private function _check_timerange()
174 174
     {
175 175
         //Force types
176
-        $this->start = (int)$this->start;
177
-        $this->end = (int)$this->end;
178
-        if (   !$this->start
176
+        $this->start = (int) $this->start;
177
+        $this->end = (int) $this->end;
178
+        if (!$this->start
179 179
             || !$this->end) {
180 180
             debug_add('Event must have start and end timestamps');
181 181
             midcom_connection::set_error(MGD_ERR_RANGE);
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
          * Force start and end seconds to 1 and 0 respectively
187 187
          * (to avoid stupid one second overlaps)
188 188
          */
189
-        $this->start = mktime(  date('G', $this->start),
189
+        $this->start = mktime(date('G', $this->start),
190 190
                                 date('i', $this->start),
191 191
                                 1,
192 192
                                 date('n', $this->start),
Please login to merge, or discard this patch.
lib/midcom/helper/nav/backend.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
         $lastgoodnode = null;
258 258
 
259
-        while (   $parent_id
259
+        while ($parent_id
260 260
                && !isset(self::$_nodes[$parent_id])) {
261 261
             try {
262 262
                 self::$_nodes[$parent_id] = $this->_loadNodeData($parent_id);
@@ -273,14 +273,14 @@  discard block
 block discarded – undo
273 273
 
274 274
             $parent_id = $this->_get_parent_id($topic_id);
275 275
 
276
-            if (   $up
276
+            if ($up
277 277
                 && $up_id = array_pop($up_ids)
278 278
                 && $up_id != $parent_id) {
279 279
                 $parent_id = $up_id;
280 280
             }
281 281
         }
282 282
 
283
-        if (   !is_null($lastgoodnode)
283
+        if (!is_null($lastgoodnode)
284 284
             && (empty($this->_lastgoodnode) || $this->_lastgoodnode < 0)) {
285 285
             $this->_lastgoodnode = $lastgoodnode;
286 286
         }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     {
317 317
         $node = new midcom_helper_nav_node($this, $topic_id, $up);
318 318
 
319
-        if (    !$node->is_object_visible()
319
+        if (!$node->is_object_visible()
320 320
              || !$node->is_readable_by($this->_user_id)) {
321 321
             throw new midcom_error_forbidden('Node cannot be read or is invisible');
322 322
         }
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         });
362 362
         foreach ($leaves as $id => $leaf) {
363 363
             $this->_leaves[$id] = $leaf;
364
-            $this->_loaded_leaves[$node->id][$id] =& $this->_leaves[$id];
364
+            $this->_loaded_leaves[$node->id][$id] = & $this->_leaves[$id];
365 365
         }
366 366
     }
367 367
 
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
             }
448 448
             $subnode_id = $this->_nodeid($id, $up);
449 449
 
450
-            if (   !$show_noentry
450
+            if (!$show_noentry
451 451
                 && self::$_nodes[$subnode_id]->noentry) {
452 452
                 // Hide "noentry" items
453 453
                 continue;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -260,10 +260,12 @@  discard block
 block discarded – undo
260 260
                && !isset(self::$_nodes[$parent_id])) {
261 261
             try {
262 262
                 self::$_nodes[$parent_id] = $this->_loadNodeData($parent_id);
263
-            } catch (midcom_error_forbidden $e) {
263
+            }
264
+            catch (midcom_error_forbidden $e) {
264 265
                 debug_add("The Node {$parent_id} is invisible, could not satisfy the dependency chain to Node #{$node_id}", MIDCOM_LOG_WARN);
265 266
                 return $e->getCode();
266
-            } catch (midcom_error $e) {
267
+            }
268
+            catch (midcom_error $e) {
267 269
                 return $e->getCode();
268 270
             }
269 271
 
@@ -287,7 +289,8 @@  discard block
 block discarded – undo
287 289
 
288 290
         try {
289 291
             self::$_nodes[$node_id] = $this->_loadNodeData($topic_id);
290
-        } catch (midcom_error $e) {
292
+        }
293
+        catch (midcom_error $e) {
291 294
             return $e->getCode();
292 295
         }
293 296
         return MIDCOM_ERROK;
Please login to merge, or discard this patch.
lib/midcom/helper/nav/node.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
     public function is_readable_by($user_id)
32 32
     {
33
-        return (   !$user_id
33
+        return (!$user_id
34 34
                 || midcom::get()->auth->acl->can_do_byguid('midgard:read', $this->guid, 'midcom_db_topic', $user_id));
35 35
     }
36 36
 
Please login to merge, or discard this patch.
lib/midcom/admin/folder/handler/edit.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 $this->_controller = midcom_helper_datamanager2_controller::create('create');
68 68
                 $this->_controller->schemadb = $schemadb;
69 69
                 $this->_controller->schemaname = 'default';
70
-                $this->_controller->callback_object =& $this;
70
+                $this->_controller->callback_object = & $this;
71 71
 
72 72
                 // Suggest to create the same type of a folder as the parent is
73 73
                 $component_suggestion = $this->_topic->component;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
         if (!$this->_new_topic->create()) {
103 103
             debug_print_r('We operated on this object:', $this->_new_topic);
104
-            throw new midcom_error('Failed to create a new topic, cannot continue. Last Midgard error was: '. midcom_connection::get_error_string());
104
+            throw new midcom_error('Failed to create a new topic, cannot continue. Last Midgard error was: ' . midcom_connection::get_error_string());
105 105
         }
106 106
 
107 107
         return $this->_new_topic;
Please login to merge, or discard this patch.
lib/midcom/core/service/implementation/urlparsertopic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
                 return false;
122 122
             }
123 123
             // No topics matching path, check for attachments
124
-            $att_qb =  midcom_db_attachment::new_query_builder();
124
+            $att_qb = midcom_db_attachment::new_query_builder();
125 125
             $att_qb->add_constraint('name', '=', $this->argv[0]);
126 126
             $att_qb->add_constraint('parentguid', '=', $this->get_current_object()->guid);
127 127
             if ($att_qb->count() == 0) {
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/schemadb.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
     private function _filter_schema_fields($key)
164 164
     {
165
-        if (   $key == 'metadata'
165
+        if ($key == 'metadata'
166 166
             || in_array($key, $this->_config->get('object_skip_fields'))) {
167 167
             return false;
168 168
         }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
     private function _add_string_field($key, $type)
174 174
     {
175
-        if (   $key == 'component'
175
+        if ($key == 'component'
176 176
             && $type == 'midcom_db_topic') {
177 177
             $this->_add_component_dropdown($key);
178 178
             return;
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
     private function _add_int_field($key)
223 223
     {
224
-        if (   $key == 'start'
224
+        if ($key == 'start'
225 225
             || $key == 'end'
226 226
             || $key == 'added'
227 227
             || $key == 'date') {
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
                 $height = 30;
266 266
 
267 267
                 // Check the user preference and configuration
268
-                if (   midgard_admin_asgard_plugin::get_preference('tinymce_enabled')
269
-                    || (   midgard_admin_asgard_plugin::get_preference('tinymce_enabled') !== '0'
268
+                if (midgard_admin_asgard_plugin::get_preference('tinymce_enabled')
269
+                    || (midgard_admin_asgard_plugin::get_preference('tinymce_enabled') !== '0'
270 270
                         && $this->_config->get('tinymce_enabled'))) {
271 271
                     $widget = 'tinymce';
272 272
                 }
@@ -279,8 +279,8 @@  discard block
 block discarded – undo
279 279
                 $height = 30;
280 280
 
281 281
                 // Check the user preference and configuration
282
-                if (   midgard_admin_asgard_plugin::get_preference('codemirror_enabled')
283
-                    || (   midgard_admin_asgard_plugin::get_preference('codemirror_enabled') !== '0'
282
+                if (midgard_admin_asgard_plugin::get_preference('codemirror_enabled')
283
+                    || (midgard_admin_asgard_plugin::get_preference('codemirror_enabled') !== '0'
284 284
                         && $this->_config->get('codemirror_enabled'))) {
285 285
                     $widget = 'codemirror';
286 286
                 }
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
         if ($score1 > $score2) {
543 543
             return 1;
544 544
         }
545
-        if (   $score1 < 3
545
+        if ($score1 < 3
546 546
             || $score1 > 6) {
547 547
             return strnatcmp($first, $second);
548 548
         }
Please login to merge, or discard this patch.
lib/net/nehmer/blog/handler/archive.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     private function _compute_welcome_posting_count($start, $end)
121 121
     {
122
-        $data =& $this->_request_data;
122
+        $data = & $this->_request_data;
123 123
         $qb = midcom_db_article::new_query_builder();
124 124
 
125 125
         $qb->add_constraint('metadata.published', '>=', $start->format('Y-m-d H:i:s'));
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
         $year_data = array();
144 144
         $first_post = $this->_compute_welcome_first_post();
145 145
         $this->_request_data['first_post'] = $first_post;
146
-        $this->_request_data['total_count'] =& $total_count;
147
-        $this->_request_data['year_data'] =& $year_data;
146
+        $this->_request_data['total_count'] = & $total_count;
147
+        $this->_request_data['year_data'] = & $year_data;
148 148
         if (!$first_post) {
149 149
             return;
150 150
         }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         switch ($handler_id) {
279 279
             case 'archive-year-category':
280 280
                 $data['category'] = trim(strip_tags($args[1]));
281
-                if (   isset($data['schemadb']['default']->fields['categories'])
281
+                if (isset($data['schemadb']['default']->fields['categories'])
282 282
                     && array_key_exists('allow_multiple', $data['schemadb']['default']->fields['categories']['type_config'])
283 283
                     && !$data['schemadb']['default']->fields['categories']['type_config']['allow_multiple']) {
284 284
                     $qb->add_constraint('extra1', '=', (string) $data['category']);
@@ -373,15 +373,15 @@  discard block
 block discarded – undo
373 373
             throw new midcom_error_notfound("The year '{$year}' is not a valid year identifier.");
374 374
         }
375 375
 
376
-        if (   $month < 1
376
+        if ($month < 1
377 377
             || $month > 12) {
378 378
             throw new midcom_error_notfound("The year {$month} is not a valid year identifier.");
379 379
         }
380 380
 
381 381
         $now = new DateTime();
382
-        $this->_start = new DateTime("{$year}-" . sprintf('%02d', $month) .  "-01 00:00:00");
382
+        $this->_start = new DateTime("{$year}-" . sprintf('%02d', $month) . "-01 00:00:00");
383 383
         if ($this->_start > $now) {
384
-            throw new midcom_error_notfound("The month '{$year}-" . sprintf('%02d', $month) .  "' is in the future, no archive available.");
384
+            throw new midcom_error_notfound("The month '{$year}-" . sprintf('%02d', $month) . "' is in the future, no archive available.");
385 385
         }
386 386
 
387 387
         if ($month == 12) {
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
             $endmonth = $month + 1;
393 393
         }
394 394
 
395
-        $this->_end = new DateTime("{$endyear}-" . sprintf('%02d', $endmonth) .  "-01 00:00:00");
395
+        $this->_end = new DateTime("{$endyear}-" . sprintf('%02d', $endmonth) . "-01 00:00:00");
396 396
     }
397 397
 
398 398
     /**
Please login to merge, or discard this patch.
lib/net/nehmer/static/midcom/interfaces.php 1 patch
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.
lib/net/nehmer/blog/handler/view.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             ));
45 45
         }
46 46
 
47
-        if (   $this->_article->topic === $this->_topic->id
47
+        if ($this->_article->topic === $this->_topic->id
48 48
             && $this->_article->can_do('midgard:delete')) {
49 49
             $delete = $this->get_workflow('delete', array('object' => $this->_article));
50 50
             $buttons[] = $delete->get_button("delete/{$this->_article->guid}/");
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
         if ($this->_config->get('enable_ajax_editing')) {
99 99
             $this->_request_data['controller'] = midcom_helper_datamanager2_controller::create('ajax');
100
-            $this->_request_data['controller']->schemadb =& $this->_request_data['schemadb'];
100
+            $this->_request_data['controller']->schemadb = & $this->_request_data['schemadb'];
101 101
             $this->_request_data['controller']->set_storage($this->_article);
102 102
             $this->_request_data['controller']->process_ajax();
103 103
         }
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         if ($this->_config->get('comments_enable')) {
106 106
             if ($comments_node = $this->_seek_comments()) {
107 107
                 $this->_request_data['comments_url'] = $comments_node[MIDCOM_NAV_RELATIVEURL] . "comment/{$this->_article->guid}";
108
-                if (   $this->_topic->can_do('midgard:update')
108
+                if ($this->_topic->can_do('midgard:update')
109 109
                     && $this->_topic->can_do('net.nehmer.comments:moderation')) {
110 110
                     net_nehmer_comments_viewer::add_head_elements();
111 111
                 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -218,7 +218,8 @@
 block discarded – undo
218 218
         if ($this->_config->get('comments_topic')) {
219 219
             try {
220 220
                 $comments_topic = new midcom_db_topic($this->_config->get('comments_topic'));
221
-            } catch (midcom_error $e) {
221
+            }
222
+            catch (midcom_error $e) {
222 223
                 return false;
223 224
             }
224 225
 
Please login to merge, or discard this patch.