Test Setup Failed
Pull Request — master (#190)
by
unknown
15:14
created
lib/midcom/baseclasses/components/handler/crud.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     {
132 132
         return;
133 133
         $indexer = midcom::get()->indexer;
134
-        $topic =& $this->_content_topic;
134
+        $topic = & $this->_content_topic;
135 135
 
136 136
         $nav = new midcom_helper_nav();
137 137
         $node = $nav->get_node($topic->id);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     {
228 228
         $prefix = $this->_get_url_prefix();
229 229
         $buttons = array();
230
-        if (   $this->_mode !== 'update'
230
+        if ($this->_mode !== 'update'
231 231
             && $this->_object->can_do('midgard:update')) {
232 232
             $workflow = $this->get_workflow('datamanager2');
233 233
             $buttons[] = $workflow->get_button($prefix . "edit/{$this->_object->guid}/", array(
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
             ));
236 236
         }
237 237
 
238
-        if (   $this->_mode !== 'delete'
238
+        if ($this->_mode !== 'delete'
239 239
             && $this->_object->can_do('midgard:delete')) {
240 240
             $workflow = $this->get_workflow('delete', array('object' => $this->_object));
241 241
             $buttons[] = $workflow->get_button($prefix . "delete/{$this->_object->guid}/");
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
      */
262 262
     public function _on_initialize()
263 263
     {
264
-        $this->_content_topic =& $this->_request_data['content_topic'];
264
+        $this->_content_topic = & $this->_request_data['content_topic'];
265 265
     }
266 266
 
267 267
     /**
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      */
272 272
     public function _load_schemadb()
273 273
     {
274
-        $this->_schemadb =& $this->_request_data['schemadb'];
274
+        $this->_schemadb = & $this->_request_data['schemadb'];
275 275
     }
276 276
 
277 277
     /**
@@ -322,13 +322,13 @@  discard block
 block discarded – undo
322 322
     public function _load_controller($type = 'simple')
323 323
     {
324 324
         $this->_controller = midcom_helper_datamanager2_controller::create($type);
325
-        $this->_controller->schemadb =& $this->_schemadb;
325
+        $this->_controller->schemadb = & $this->_schemadb;
326 326
 
327 327
         if ($type == 'create') {
328 328
             // Creation controller, give additional parameters
329 329
             $this->_controller->schemaname = $this->_schema;
330 330
             $this->_controller->defaults = $this->_defaults;
331
-            $this->_controller->callback_object =& $this;
331
+            $this->_controller->callback_object = & $this;
332 332
         } else {
333 333
             if (!$this->_object) {
334 334
                 throw new midcom_error_notfound("No object defined for DM2.");
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
             // AJAX editing is possible
427 427
             $this->_load_controller('ajax');
428 428
             $this->_controller->process_ajax();
429
-            $this->_datamanager =& $this->_controller->datamanager;
429
+            $this->_datamanager = & $this->_controller->datamanager;
430 430
         } else {
431 431
             $this->_load_datamanager();
432 432
         }
Please login to merge, or discard this patch.
lib/midcom/baseclasses/components/handler/dataexport.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function _prepare_request_data()
50 50
     {
51
-        $this->_request_data['datamanagers'] =& $this->_datamanagers;
52
-        $this->_request_data['rows'] =& $this->_rows;
51
+        $this->_request_data['datamanagers'] = & $this->_datamanagers;
52
+        $this->_request_data['rows'] = & $this->_rows;
53 53
     }
54 54
 
55 55
     /**
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
 
133 133
         foreach ($this->_datamanagers as $type => $datamanager) {
134 134
             foreach ($datamanager->schema->field_order as $name) {
135
-                $title =& $datamanager->schema->fields[$name]['title'];
136
-                $fieldtype =& $datamanager->schema->fields[$name]['type'];
137
-                if (   $this->include_totals
135
+                $title = & $datamanager->schema->fields[$name]['title'];
136
+                $fieldtype = & $datamanager->schema->fields[$name]['type'];
137
+                if ($this->include_totals
138 138
                     && $fieldtype == 'number') {
139 139
                     $this->_totals[$type . '-' . $name] = 0;
140 140
                 }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             $row = array();
154 154
             foreach ($this->_datamanagers as $type => $datamanager) {
155 155
                 foreach ($datamanager->schema->field_order as $name) {
156
-                    $fieldtype =& $datamanager->schema->fields[$name]['type'];
156
+                    $fieldtype = & $datamanager->schema->fields[$name]['type'];
157 157
                     $value = "";
158 158
                     if ($fieldtype == 'number') {
159 159
                         $value = $this->_totals[$type . '-' . $name];
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
                     $output = array_pad($output, $target_size, '');
182 182
                     continue;
183 183
                 }
184
-                $object =& $row[$type];
184
+                $object = & $row[$type];
185 185
 
186 186
                 if (!$datamanager->set_storage($object)) {
187 187
                     // Major error, panic
188
-                    throw new midcom_error( "Could not set_storage for row #{$num} ({$type} {$object->guid})");
188
+                    throw new midcom_error("Could not set_storage for row #{$num} ({$type} {$object->guid})");
189 189
                 }
190 190
 
191
-                if (   $this->include_guid
191
+                if ($this->include_guid
192 192
                     && $type == $first_type) {
193 193
                     $output[] = $object->guid;
194 194
                 }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                 foreach ($datamanager->schema->field_order as $fieldname) {
197 197
                     $fieldtype = $datamanager->schema->fields[$fieldname]['type'];
198 198
                     $data = $datamanager->types[$fieldname]->convert_to_csv();
199
-                    if (   $this->include_totals
199
+                    if ($this->include_totals
200 200
                         && $fieldtype == 'number') {
201 201
                         $this->_totals[$type . '-' . $fieldname] += $data;
202 202
                     }
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         if (empty($this->csv['charset'])) {
232 232
             // Default to ISO-LATIN-15 (Latin-1 with EURO sign etc)
233 233
             $this->csv['charset'] = 'ISO-8859-15';
234
-            if (   isset($_SERVER['HTTP_USER_AGENT'])
234
+            if (isset($_SERVER['HTTP_USER_AGENT'])
235 235
                 && !preg_match('/Windows/i', $_SERVER['HTTP_USER_AGENT'])) {
236 236
                 // Excep when not on windows, then default to UTF-8
237 237
                 $this->csv['charset'] = 'UTF-8';
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
         }
260 260
 
261 261
         // Strings and numbers beginning with zero are quoted
262
-        if (   !empty($data)
263
-            && (   !is_numeric($data)
262
+        if (!empty($data)
263
+            && (!is_numeric($data)
264 264
                 || preg_match('/^[0+]/', $data))) {
265 265
             // Make sure we have only newlines in data
266 266
             $data = preg_replace("/\n\r|\r\n|\r/", "\n", $data);
Please login to merge, or discard this patch.
lib/midcom/baseclasses/components/handler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,12 +100,12 @@
 block discarded – undo
100 100
     {
101 101
         $this->_master = $master;
102 102
 
103
-        $this->_request_data =& $master->_request_data;
103
+        $this->_request_data = & $master->_request_data;
104 104
         $this->_topic = $master->_topic;
105 105
 
106 106
         // Load component specific stuff, special treatment if the handler has
107 107
         // a component different than the master handler set.
108
-        if (   $this->_component
108
+        if ($this->_component
109 109
             && $this->_component != $master->_component) {
110 110
             $this->_config->store_from_object($this->_topic, $this->_component, true);
111 111
         } else {
Please login to merge, or discard this patch.
lib/midcom/baseclasses/components/interface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@
 block discarded – undo
242 242
      */
243 243
     public function can_handle($current_object, $argc, $argv, $contextid)
244 244
     {
245
-        $data =& $this->_context_data[$contextid];
245
+        $data = & $this->_context_data[$contextid];
246 246
         $loader = midcom::get()->componentloader;
247 247
         $class = $loader->path_to_prefix($this->_component) . '_' . $this->_site_class_suffix;
248 248
         $data['handler'] = new $class($current_object, $data['config']);
Please login to merge, or discard this patch.
lib/midcom/style/midcom_helper_datamanager2_unlock.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,8 @@
 block discarded – undo
4 4
 try {
5 5
     $person = new midcom_db_person($metadata->locker);
6 6
     $name = $person->name;
7
-} catch (midcom_error $e) {
7
+}
8
+catch (midcom_error $e) {
8 9
     $name = $this->data['handler']->_l10n_midcom->get('unknown user');
9 10
     $e->log();
10 11
 }
Please login to merge, or discard this patch.
lib/midcom/admin/folder/handler/metadata.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         $schemadb = midcom_helper_datamanager2_schema::load_database(midcom::get()->config->get('metadata_schema'));
38 38
 
39 39
         $this->_controller = midcom_helper_datamanager2_controller::create('simple');
40
-        $this->_controller->schemadb =& $schemadb;
40
+        $this->_controller->schemadb = & $schemadb;
41 41
 
42 42
         $object_schema = midcom_helper_metadata::find_schemaname($schemadb, $this->_object);
43 43
 
Please login to merge, or discard this patch.
lib/midcom/admin/folder/handler/move.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $this->_object = midcom::get()->dbfactory->get_object_by_guid($args[0]);
36 36
 
37
-        if (   !is_a($this->_object, 'midcom_db_topic')
37
+        if (!is_a($this->_object, 'midcom_db_topic')
38 38
             && !is_a($this->_object, 'midcom_db_article')) {
39 39
             throw new midcom_error_notfound("Moving only topics and articles is supported.");
40 40
         }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $folder = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ROOTTOPIC);
79 79
         }
80 80
 
81
-        if (   is_a($this->_object, 'midcom_db_topic')
81
+        if (is_a($this->_object, 'midcom_db_topic')
82 82
             && $folder->up == $this->_object->id) {
83 83
             $tree_disabled = true;
84 84
         }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             $selected = ' checked="checked"';
92 92
         }
93 93
 
94
-        if (   !is_a($this->_object, 'midcom_db_topic')
94
+        if (!is_a($this->_object, 'midcom_db_topic')
95 95
             && $folder->component !== $this->_request_data['current_folder']->component) {
96 96
             // Non-topic objects may only be moved under folders of same component
97 97
             $class = 'wrong_component';
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $move_to_topic = new midcom_db_topic();
128 128
 
129 129
         if (!$move_to_topic->get_by_id($target)) {
130
-            throw new midcom_error( 'Failed to move the topic. Could not get the target topic');
130
+            throw new midcom_error('Failed to move the topic. Could not get the target topic');
131 131
         }
132 132
 
133 133
         $move_to_topic->require_do('midgard:create');
Please login to merge, or discard this patch.
lib/midcom/exec/touch_attachments.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,8 @@
 block discarded – undo
16 16
 foreach ($atts as $att) {
17 17
     try {
18 18
         $att->file_to_cache();
19
-    } catch (midcom_error $e) {
19
+    }
20
+    catch (midcom_error $e) {
20 21
         echo 'Error: ' . $e->getMessage() . "\n";
21 22
     }
22 23
 }
Please login to merge, or discard this patch.
lib/midcom/exec/reindex.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
 $http_client = new org_openpsa_httplib();
57 57
 $http_client->set_param('timeout', 300);
58
-if (   !empty($_SERVER['PHP_AUTH_USER'])
58
+if (!empty($_SERVER['PHP_AUTH_USER'])
59 59
     && !empty($_SERVER['PHP_AUTH_PW'])) {
60 60
     $http_client->basicauth['user'] = $_SERVER['PHP_AUTH_USER'];
61 61
     $http_client->basicauth['password'] = $_SERVER['PHP_AUTH_PW'];
Please login to merge, or discard this patch.