Passed
Branch master (7a7694)
by Andreas
18:25
created
lib/midgard/admin/asgard/handler/object/manage.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,8 @@
 block discarded – undo
61 61
     {
62 62
         try {
63 63
             $this->_object = midcom::get()->dbfactory->get_object_by_guid($guid);
64
-        } catch (midcom_error $e) {
64
+        }
65
+        catch (midcom_error $e) {
65 66
             if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) {
66 67
                 $relocate = $this->router->generate('object_deleted', ['guid' => $guid]);
67 68
                 midcom::get()->relocate($relocate);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -223,10 +223,10 @@
 block discarded – undo
223 223
             $new_type_reflector = midcom_helper_reflector::get($new_type);
224 224
             $link_properties = $new_type_reflector->get_link_properties();
225 225
             foreach ($link_properties as $property => $link) {
226
-                if (   ($link['class'] && midcom_helper_reflector::is_same_class($link['class'], $this->_object->__mgdschema_class_name__))
226
+                if (($link['class'] && midcom_helper_reflector::is_same_class($link['class'], $this->_object->__mgdschema_class_name__))
227 227
                     || $link['type'] == MGD_TYPE_GUID) {
228 228
                     $defaults[$property] = $this->_object->{$link['target']};
229
-                } elseif (   $property == $parent_property
229
+                } elseif ($property == $parent_property
230 230
                           && midcom_helper_reflector::is_same_class($new_type, $this->_object->__mgdschema_class_name__)) {
231 231
                     $defaults[$property] = $this->_object->$parent_property;
232 232
                 }
Please login to merge, or discard this patch.
lib/org/openpsa/user/style/show-person-account.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
             echo '<span class="toolbar_label">' . $data['l10n_midcom']->get('delete') . '</span></a></li>';
27 27
             if (    midcom::get()->config->get('auth_allow_trusted') === true
28 28
                  && $data['person']->can_do('org.openpsa.user:su')) {
29
-                 echo '<li><a class="button" href="' . $data['router']->generate('account_su', ['guid' => $data['person']->guid]) . '" />' . $data['l10n']->get('switch to user') . "</a></li>\n";
29
+                    echo '<li><a class="button" href="' . $data['router']->generate('account_su', ['guid' => $data['person']->guid]) . '" />' . $data['l10n']->get('switch to user') . "</a></li>\n";
30 30
             }
31 31
             echo "</ul>\n";
32 32
         }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
             $formatter = $data['l10n']->get_formatter();
14 14
             echo '<p>' . $data['l10n']->get('last login') . ': ' . $formatter->datetime($lastlogin) . "</p>\n";
15 15
         }
16
-        if (   $data['person']->id == midcom_connection::get_user()
16
+        if ($data['person']->id == midcom_connection::get_user()
17 17
             || midcom::get()->auth->can_user_do('org.openpsa.user:manage', null, org_openpsa_user_interface::class)) {
18 18
             $workflow = new midcom\workflow\datamanager;
19 19
             echo '<ul class="area_toolbar">';
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
                 'object' => $data['person'],
23 23
                 'label' => $data['l10n']->get('account')
24 24
             ]);
25
-            echo '<li><a href="' . $data['router']->generate('account_delete', ['guid' => $data['person']->guid]). '" ' . $workflow->render_attributes() . '"  class="button">';
25
+            echo '<li><a href="' . $data['router']->generate('account_delete', ['guid' => $data['person']->guid]) . '" ' . $workflow->render_attributes() . '"  class="button">';
26 26
             echo '<span class="toolbar_label">' . $data['l10n_midcom']->get('delete') . '</span></a></li>';
27
-            if (    midcom::get()->config->get('auth_allow_trusted') === true
27
+            if (midcom::get()->config->get('auth_allow_trusted') === true
28 28
                  && $data['person']->can_do('org.openpsa.user:su')) {
29 29
                  echo '<li><a class="button" href="' . $data['router']->generate('account_su', ['guid' => $data['person']->guid]) . '" />' . $data['l10n']->get('switch to user') . "</a></li>\n";
30 30
             }
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         }
33 33
     } else {
34 34
         echo '<p><span class="metadata">' . $data['l10n']->get("no account") . '</span></p>';
35
-        if (   $data['person']->id == midcom_connection::get_user()
35
+        if ($data['person']->id == midcom_connection::get_user()
36 36
             || midcom::get()->auth->can_user_do('org.openpsa.user:manage', null, org_openpsa_user_interface::class)) {
37 37
             $workflow = new midcom\workflow\datamanager;
38 38
             echo '<ul class="area_toolbar">';
Please login to merge, or discard this patch.
lib/org/openpsa/user/handler/person/view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $this->add_breadcrumb('', $this->_person->get_label());
37 37
 
38 38
         $auth = midcom::get()->auth;
39
-        if (   $this->_person->id == midcom_connection::get_user()
39
+        if ($this->_person->id == midcom_connection::get_user()
40 40
             || $auth->can_user_do('org.openpsa.user:manage', null, org_openpsa_user_interface::class)) {
41 41
             $buttons = [];
42 42
             $workflow = $this->get_workflow('datamanager');
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                 $delete_workflow = $this->get_workflow('delete', ['object' => $this->_person]);
50 50
                 $buttons[] = $delete_workflow->get_button($this->router->generate('user_delete', ['guid' => $this->_person->guid]));
51 51
             }
52
-            if (   midcom_connection::is_user($this->_person)
52
+            if (midcom_connection::is_user($this->_person)
53 53
                 && $this->_person->can_do('midgard:privileges')) {
54 54
                 $buttons[] = $workflow->get_button($this->router->generate('user_privileges', ['guid' => $this->_person->guid]), [
55 55
                     MIDCOM_TOOLBAR_LABEL => $this->_l10n->get("permissions"),
Please login to merge, or discard this patch.
lib/org/openpsa/directmarketing/viewer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     private function _populate_node_toolbar()
22 22
     {
23
-        if (   $this->_topic->can_do('midgard:update')
23
+        if ($this->_topic->can_do('midgard:update')
24 24
             && $this->_topic->can_do('midcom:component_config')) {
25 25
             $workflow = $this->get_workflow('datamanager');
26 26
             $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [
Please login to merge, or discard this patch.
lib/org/openpsa/documents/style/show-search-form-simple.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 $search_config = org_openpsa_widgets_ui::get_search_providers();
3
-if (   array_key_exists('org.openpsa.documents', $search_config)
3
+if (array_key_exists('org.openpsa.documents', $search_config)
4 4
     && midcom::get()->indexer->enabled()) {
5 5
     $url = $data['router']->generate('search'); ?>
6 6
 <div class="area" id="document_search">
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/frontpage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
         }
59 59
         $this->_view_toolbar->add_items($buttons);
60 60
 
61
-        if (   $this->_topic->can_do('midgard:update')
61
+        if ($this->_topic->can_do('midgard:update')
62 62
             && $this->_topic->can_do('midcom:component_config')) {
63 63
             $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [
64 64
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'),
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/handler/group/view.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             ];
49 49
         }
50 50
 
51
-        if (   midcom::get()->auth->can_user_do('midgard:create', null, org_openpsa_contacts_person_dba::class)
51
+        if (midcom::get()->auth->can_user_do('midgard:create', null, org_openpsa_contacts_person_dba::class)
52 52
             && $this->group->can_do('midgard:create')) {
53 53
                 $buttons[] = $workflow->get_button($this->router->generate('person_new_group', ['guid' => $this->group->guid]), [
54 54
                 MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create person'),
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         $siteconfig = org_openpsa_core_siteconfig::get_instance();
60 60
         $user_url = $siteconfig->get_node_full_url('org.openpsa.user');
61
-        if (   $user_url
61
+        if ($user_url
62 62
             && midcom::get()->auth->can_user_do('org.openpsa.user:access', null, org_openpsa_user_interface::class)) {
63 63
             $buttons[] = [
64 64
                 MIDCOM_TOOLBAR_URL => $user_url . "group/{$this->group->guid}/",
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/handler/list.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
171 171
     {
172 172
         $this->prepare_toolbar(false);
173 173
 
174
-        if (   $this->_topic->can_do('midgard:update')
174
+        if ($this->_topic->can_do('midgard:update')
175 175
             && $this->_topic->can_do('midcom:component_config')) {
176 176
             $workflow = $this->get_workflow('datamanager');
177 177
             $this->_node_toolbar->add_item($workflow->get_button($this->router->generate('config'), [
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,7 +104,8 @@  discard block
 block discarded – undo
104 104
                 $customer = org_openpsa_contacts_group_dba::get_cached($invoice->customer);
105 105
                 $entry['customer'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $customer->guid])}\">" . $customer->get_label() . "</a>";
106 106
                 $entry['index_customer'] = $customer->get_label();
107
-            } catch (midcom_error $e) {
107
+            }
108
+            catch (midcom_error $e) {
108 109
                 $entry['customer'] = '';
109 110
                 $entry['index_customer'] = '';
110 111
             }
@@ -115,7 +116,8 @@  discard block
 block discarded – undo
115 116
                 $contact = org_openpsa_contacts_person_dba::get_cached($invoice->customerContact);
116 117
                 $entry['contact'] = "<a href=\"{$this->router->generate('list_customer_all', ['guid' => $contact->guid])}\">" . $contact->get_label() . "</a>";
117 118
                 $entry['index_contact'] = $contact->get_label();
118
-            } catch (midcom_error $e) {
119
+            }
120
+            catch (midcom_error $e) {
119 121
                 $entry['contact'] = '';
120 122
                 $entry['index_contact'] = '';
121 123
             }
@@ -267,7 +269,8 @@  discard block
 block discarded – undo
267 269
     {
268 270
         try {
269 271
             $this->_customer = new org_openpsa_contacts_group_dba($guid);
270
-        } catch (midcom_error $e) {
272
+        }
273
+        catch (midcom_error $e) {
271 274
             $this->_customer = new org_openpsa_contacts_person_dba($guid);
272 275
         }
273 276
         $data['customer'] = $this->_customer;
Please login to merge, or discard this patch.
lib/org/openpsa/projects/handler/task/list.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
             case 'proposed':
170 170
                 $html = $this->render_status($task->manager, "from %s");
171 171
                 $task->get_members();
172
-                if (   $task->can_do('midgard:update')
172
+                if ($task->can_do('midgard:update')
173 173
                     && isset($task->resources[midcom_connection::get_user()])) {
174 174
                     $html .= '<form method="post" action="' . $this->router->generate('workflow', ['guid' => $task->guid]) . '">';
175 175
                     //TODO: If we need all resources to accept task hide tools when we have accepted and replace with "pending acceptance from..."
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -291,7 +291,8 @@  discard block
 block discarded – undo
291 291
             $url = $this->router->generate('project', ['guid' => $project->guid]);
292 292
             $ret['project'] = '<a href="' . $url . '">' . $project->title . '</a>';
293 293
             $ret['index_project'] = $project->title;
294
-        } catch (midcom_error $e) {
294
+        }
295
+        catch (midcom_error $e) {
295 296
             $e->log();
296 297
         }
297 298
 
@@ -303,7 +304,8 @@  discard block
 block discarded – undo
303 304
                 $customer_url = "{$contacts_url}group/{$customer->guid}/";
304 305
                 $ret['customer'] = "<a href='{$customer_url}' title='{$customer->official}'>{$customer->get_label()}</a>";
305 306
                 $ret['index_customer'] = $customer->name;
306
-            } catch (midcom_error $e) {
307
+            }
308
+            catch (midcom_error $e) {
307 309
                 $ret['customer'] = '';
308 310
                 $ret['index_customer'] = '';
309 311
             }
Please login to merge, or discard this patch.