Test Failed
Branch master (8d1702)
by Andreas
11:03
created
lib/midgard/admin/asgard/handler/object/attachments.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         }
68 68
 
69 69
         // Check if we have an uploaded file
70
-        if (   isset($_FILES['midgard_admin_asgard_file'])
70
+        if (isset($_FILES['midgard_admin_asgard_file'])
71 71
             && is_uploaded_file($_FILES['midgard_admin_asgard_file']['tmp_name'])) {
72 72
             return $this->_process_file_upload($_FILES['midgard_admin_asgard_file']);
73 73
         }
@@ -86,19 +86,19 @@  discard block
 block discarded – undo
86 86
 
87 87
         $needs_update = false;
88 88
 
89
-        if (   !empty($_POST['midgard_admin_asgard_filename'])
89
+        if (!empty($_POST['midgard_admin_asgard_filename'])
90 90
             && $local_file->name != $_POST['midgard_admin_asgard_filename']) {
91 91
             $local_file->name = $_POST['midgard_admin_asgard_filename'];
92 92
             $needs_update = true;
93 93
         }
94 94
 
95
-        if (   !empty($_POST['midgard_admin_asgard_mimetype'])
95
+        if (!empty($_POST['midgard_admin_asgard_mimetype'])
96 96
             && $local_file->mimetype != $_POST['midgard_admin_asgard_mimetype']) {
97 97
             $local_file->mimetype = $_POST['midgard_admin_asgard_mimetype'];
98 98
             $needs_update = true;
99 99
         }
100 100
 
101
-        if (   $needs_update
101
+        if ($needs_update
102 102
             && !$local_file->update()) {
103 103
             return false;
104 104
         }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         $this->bind_view_to_object($this->_file);
233 233
 
234 234
         $filename = $this->_process_form();
235
-        if (   $filename
235
+        if ($filename
236 236
             && $filename != $data['filename']) {
237 237
             return new midcom_response_relocate("__mfa/asgard/object/attachments/{$this->_object->guid}/{$filename}/");
238 238
         }
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/handler/object/permissions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $tmp = $this->_object;
101 101
 
102 102
         $i = 0;
103
-        while (   !empty($tmp->guid)
103
+        while (!empty($tmp->guid)
104 104
                && !midcom::get()->dbfactory->is_a($tmp, 'midgard_topic')
105 105
                && $i < 100) {
106 106
             // Get the parent; wishing eventually to get a topic
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         foreach ($assignees as $assignee => $label) {
197 197
             foreach ($this->_privileges as $privilege) {
198 198
                 $privilege_components = explode(':', $privilege);
199
-                if (   $privilege_components[0] == 'midcom'
199
+                if ($privilege_components[0] == 'midcom'
200 200
                     || $privilege_components[0] == 'midgard') {
201 201
                     // This is one of the core privileges, we handle it
202 202
                     $privilege_label = $privilege;
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                 if (is_object($assignee)) {
251 251
                     $label = $assignee->name;
252 252
                 } else {
253
-                    $label = $this->_l10n->get('ghost assignee for '. $privilege->assignee);
253
+                    $label = $this->_l10n->get('ghost assignee for ' . $privilege->assignee);
254 254
                 }
255 255
             }
256 256
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
     private function _render_row_label($row_name)
406 406
     {
407 407
         foreach ($this->_row_labels as $key => $label) {
408
-            if (   strpos($row_name, $key) !== false
408
+            if (strpos($row_name, $key) !== false
409 409
                 && !isset($this->_rendered_row_labels[$key])) {
410 410
                 $this->_rendered_row_labels[$key] = true;
411 411
 
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/handler/type.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@
 block discarded – undo
109 109
         }
110 110
 
111 111
         $help = new midcom_admin_help_help();
112
-        $this->_request_data['help'] =  $help->get_help_contents('asgard_'.$this->type, $help_component);
113
-        $this->_request_data['component'] =  $component;
112
+        $this->_request_data['help'] = $help->get_help_contents('asgard_' . $this->type, $help_component);
113
+        $this->_request_data['component'] = $component;
114 114
     }
115 115
 
116 116
     /**
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/handler/shell.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,10 +36,10 @@
 block discarded – undo
36 36
                 break;
37 37
 
38 38
             case 'edit':
39
-                if (   $controller->formmanager->form->isSubmitted()
39
+                if ($controller->formmanager->form->isSubmitted()
40 40
                     && !empty($controller->datamanager->validation_errors)) {
41 41
                     foreach ($controller->datamanager->validation_errors as $field => $error) {
42
-                        $element =& $controller->formmanager->form->getElement($field);
42
+                        $element = & $controller->formmanager->form->getElement($field);
43 43
                         $message = sprintf($this->_l10n->get('validation error in field %s: %s'), $element->getLabel(), $error);
44 44
                         midcom::get()->uimessages->add(
45 45
                                 $this->_l10n->get('midgard.admin.asgard'),
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/handler/welcome.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
         // List installed MgdSchema types and convert to DBA classes
22 22
         foreach ($this->_request_data['schema_types'] as $schema_type) {
23
-            if (   !is_null($type)
23
+            if (!is_null($type)
24 24
                 && $schema_type != $type) {
25 25
                 // Skip
26 26
                 continue;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                 $qb->add_constraint('metadata.revised', '>=', $since);
50 50
             }
51 51
 
52
-            if (   $only_mine
52
+            if ($only_mine
53 53
                 && midcom::get()->auth->user) {
54 54
                 $qb->add_constraint('metadata.authors', 'LIKE', '|' . midcom::get()->auth->user->guid . '|');
55 55
             }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         $data['view_title'] = $this->_l10n->get('asgard');
95 95
 
96
-        if (    isset($_POST['execute_mass_action'])
96
+        if (isset($_POST['execute_mass_action'])
97 97
              && !empty($_POST['selections'])
98 98
              && isset($_POST['mass_action'])) {
99 99
             $method_name = "_mass_{$_POST['mass_action']}";
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
             }
109 109
 
110 110
             $data['review_by'] = null;
111
-            if (   $this->_config->get('enable_review_dates')
111
+            if ($this->_config->get('enable_review_dates')
112 112
                 && isset($_REQUEST['review_by'])
113 113
                 && $_REQUEST['review_by'] != 'any') {
114 114
                 $data['review_by'] = (int) $_REQUEST['review_by'];
115 115
             }
116 116
 
117 117
             $data['type_filter'] = null;
118
-            if (   isset($_REQUEST['type_filter'])
118
+            if (isset($_REQUEST['type_filter'])
119 119
                 && $_REQUEST['type_filter'] != 'any') {
120 120
                 $data['type_filter'] = $_REQUEST['type_filter'];
121 121
             }
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                 continue;
275 275
             }
276 276
 
277
-            if (   $object->can_do('midgard:update')
277
+            if ($object->can_do('midgard:update')
278 278
                 && $object->can_do('midcom:approve')) {
279 279
                 $object->metadata->approve();
280 280
                 midcom::get()->uimessages->add($this->_l10n->get('midgard.admin.asgard'), sprintf($this->_l10n->get('object %s approved'), $object->guid));
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,7 +147,8 @@  discard block
 block discarded – undo
147 147
         foreach ($activities as $activity) {
148 148
             try {
149 149
                 $object = midcom::get()->dbfactory->get_object_by_guid($activity->target);
150
-            } catch (midcom_error $e) {
150
+            }
151
+            catch (midcom_error $e) {
151 152
                 if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) {
152 153
                     // TODO: Visualize deleted objects somehow
153 154
                 }
@@ -155,7 +156,8 @@  discard block
 block discarded – undo
155 156
             }
156 157
             try {
157 158
                 $actor = midcom_db_person::get_cached($activity->actor);
158
-            } catch (midcom_error $e) {
159
+            }
160
+            catch (midcom_error $e) {
159 161
                 $actor = null;
160 162
             }
161 163
 
@@ -253,7 +255,8 @@  discard block
 block discarded – undo
253 255
         foreach ($guids as $guid) {
254 256
             try {
255 257
                 $object = midcom::get()->dbfactory->get_object_by_guid($guid);
256
-            } catch (midcom_error $e) {
258
+            }
259
+            catch (midcom_error $e) {
257 260
                 continue;
258 261
             }
259 262
 
@@ -270,7 +273,8 @@  discard block
 block discarded – undo
270 273
         foreach ($guids as $guid) {
271 274
             try {
272 275
                 $object = midcom::get()->dbfactory->get_object_by_guid($guid);
273
-            } catch (midcom_error $e) {
276
+            }
277
+            catch (midcom_error $e) {
274 278
                 continue;
275 279
             }
276 280
 
Please login to merge, or discard this patch.
lib/midgard/admin/asgard/plugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         }
154 154
         $data['default_mode'] = 'view';
155 155
 
156
-        if (   !midgard_admin_asgard_plugin::get_preference('edit_mode')
156
+        if (!midgard_admin_asgard_plugin::get_preference('edit_mode')
157 157
             && midcom_baseclasses_components_configuration::get('midgard.admin.asgard', 'config')->get('edit_mode') == 1) {
158 158
             $data['default_mode'] = 'edit';
159 159
         } elseif (midgard_admin_asgard_plugin::get_preference('edit_mode') == 1) {
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 
195 195
         $parent = $object->get_parent();
196 196
 
197
-        if (   is_a($object, 'midcom_db_parameter')
197
+        if (is_a($object, 'midcom_db_parameter')
198 198
             && is_object($parent)
199 199
             && $parent->guid) {
200 200
             // Add "parameters" list to breadcrumb if we're in a param
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         }
206 206
 
207 207
         $i = 0;
208
-        while (   is_object($parent)
208
+        while (is_object($parent)
209 209
                && $parent->guid
210 210
                && $i < 10) {
211 211
             $i++;
Please login to merge, or discard this patch.
src/openpsa/createphp/workflow/delete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 {
20 20
     public function getToolbarConfig($object)
21 21
     {
22
-        if (    $object->can_do('midgard:delete')
22
+        if ($object->can_do('midgard:delete')
23 23
              && !empty($object->up)) {
24 24
             // show delete for all collection children
25 25
             return array(
Please login to merge, or discard this patch.
src/midcom/workflow/datamanager2.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,8 +93,8 @@
 block discarded – undo
93 93
 
94 94
     private function prepare_url($url)
95 95
     {
96
-        if (   substr($url, 0, 1) != '/'
97
-            && ! preg_match('|^https?://|', $url)) {
96
+        if (substr($url, 0, 1) != '/'
97
+            && !preg_match('|^https?://|', $url)) {
98 98
             $url = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . $url;
99 99
         }
100 100
         return '"' . $url . '"';
Please login to merge, or discard this patch.
src/midcom/workflow/delete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
             ))
89 89
             ->setRequired('object')
90 90
             ->setAllowedTypes('object', 'midcom_core_dbaobject')
91
-            ->setNormalizer('label', function ($options, $value) {
91
+            ->setNormalizer('label', function($options, $value) {
92 92
                 if ($value === null) {
93 93
                     return midcom_helper_reflector::get_object_title($options['object']);
94 94
                 }
Please login to merge, or discard this patch.