Test Failed
Branch master (8d1702)
by Andreas
11:03
created
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.
lib/midcom/core/query.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
     protected function _add_visibility_checks()
137 137
     {
138
-        if (   !$this->_visibility_checks_added
138
+        if (!$this->_visibility_checks_added
139 139
             && $this->hide_invisible
140 140
             && !midcom::get()->config->get('show_hidden_objects')) {
141 141
             $this->add_constraint('metadata.hidden', '=', false);
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         // Deal with empty arrays, which would produce invalid queries
182 182
         // This is done here to avoid repetitive code in callers, and because
183 183
         // it's easy enough to generalize: IN empty set => always false, NOT IN empty set => always true
184
-        if (   is_array($value)
184
+        if (is_array($value)
185 185
             && empty($value)) {
186 186
             if ($operator == 'NOT IN') {
187 187
                 return true;
Please login to merge, or discard this patch.