Passed
Push — master ( 3593e9...a8e86d )
by Andreas
28:08
created
lib/org/openpsa/documents/directory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $ownerwg = $this->get_parameter('org.openpsa.core', 'orgOpenpsaOwnerWg');
21 21
         $accesstype = $this->get_parameter('org.openpsa.core', 'orgOpenpsaAccesstype');
22 22
 
23
-        if (   $ownerwg
23
+        if ($ownerwg
24 24
             && $accesstype) {
25 25
             // Sync the object's ACL properties into MidCOM ACL system
26 26
             $sync = new org_openpsa_core_acl_synchronizer();
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     private function _update_parent_timestamp()
42 42
     {
43 43
         $parent = $this->get_parent();
44
-        if (   $parent
44
+        if ($parent
45 45
             && $parent->component == 'org.openpsa.documents') {
46 46
             midcom::get()->auth->request_sudo('org.openpsa.documents');
47 47
 
Please login to merge, or discard this patch.
lib/org/openpsa/httplib/exec/test_post.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
 } else {
19 19
     $client = new org_openpsa_httplib();
20
-    if (   !empty($_REQUEST['username'])
20
+    if (!empty($_REQUEST['username'])
21 21
         && !empty($_REQUEST['password'])) {
22 22
         $client->basicauth['user'] = $_REQUEST['username'];
23 23
         $client->basicauth['password'] = $_REQUEST['password'];
Please login to merge, or discard this patch.
lib/org/openpsa/mail/exec/test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 midcom::get()->auth->require_admin_user();
3 3
 
4
-if (   empty($_POST['to'])
4
+if (empty($_POST['to'])
5 5
     || empty($_POST['from'])) {
6 6
     ?>
7 7
     <h2>Send test email</h2>
Please login to merge, or discard this patch.
lib/org/openpsa/notifications/main.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,8 @@
 block discarded – undo
52 52
         // TODO: Should we sudo here to ensure getting correct prefs regardless of ACLs?
53 53
         try {
54 54
             $recipient = midcom_db_person::get_cached($recipient);
55
-        } catch (midcom_error $e) {
55
+        }
56
+        catch (midcom_error $e) {
56 57
             return false;
57 58
         }
58 59
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
 
103 103
         // If user has preference for this message, we use that
104 104
         $personal_preferences = $recipient->list_parameters('org.openpsa.notifications');
105
-        if (   !empty($personal_preferences)
105
+        if (!empty($personal_preferences)
106 106
             && array_key_exists("{$component}:{$action}", $personal_preferences)) {
107 107
             return $personal_preferences[$action];
108 108
         }
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/scheduler.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,8 @@
 block discarded – undo
126 126
         $salesproject = org_openpsa_sales_salesproject_dba::get_cached($this->_deliverable->salesproject);
127 127
         try {
128 128
             $owner = midcom_db_person::get_cached($salesproject->owner);
129
-        } catch (midcom_error $e) {
129
+        }
130
+        catch (midcom_error $e) {
130 131
             $e->log();
131 132
             return;
132 133
         }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         }
96 96
 
97 97
         // TODO: Warehouse management: create new order
98
-        if (   $this->_deliverable->end < $next_cycle_start
98
+        if ($this->_deliverable->end < $next_cycle_start
99 99
             && $this->_deliverable->end != 0) {
100 100
             debug_add('Do not register next cycle, the contract ends before');
101 101
             return $this->_deliverable->end_subscription();
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         }
329 329
 
330 330
         //If previous cycle was run at the end of the month, the new one should be at the end of the month as well
331
-        if (   $date->format('t') == $date->format('j')
331
+        if ($date->format('t') == $date->format('j')
332 332
             && $new_date->format('t') != $new_date->format('j')) {
333 333
             $new_date->setDate((int) $new_date->format('Y'), (int) $new_date->format('m'), (int) $new_date->format('t'));
334 334
         }
Please login to merge, or discard this patch.
lib/org/openpsa/sales/handler/deliverable/view.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,8 @@
 block discarded – undo
51 51
         }
52 52
         try {
53 53
             $this->_request_data['product'] = org_openpsa_products_product_dba::get_cached($this->_deliverable->product);
54
-        } catch (midcom_error $e) {
54
+        }
55
+        catch (midcom_error $e) {
55 56
             $this->_request_data['product'] = false;
56 57
         }
57 58
     }
Please login to merge, or discard this patch.
lib/org/openpsa/sales/handler/list.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,8 @@
 block discarded – undo
113 113
         try {
114 114
             $this->_request_data['customer'] = new org_openpsa_contacts_group_dba($guid);
115 115
             $qb->add_constraint('customer', '=', $this->_request_data['customer']->id);
116
-        } catch (midcom_error $e) {
116
+        }
117
+        catch (midcom_error $e) {
117 118
             $this->_request_data['customer'] = new org_openpsa_contacts_person_dba($guid);
118 119
             $qb->add_constraint('customerContact', '=', $this->_request_data['customer']->id);
119 120
         }
Please login to merge, or discard this patch.
lib/org/openpsa/contacts/midcom/interfaces.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,8 @@
 block discarded – undo
159 159
 
160 160
         try {
161 161
             $object = new $classname($guid);
162
-        } catch (midcom_error $e) {
162
+        }
163
+        catch (midcom_error $e) {
163 164
             $handler->print_error($type . " {$guid} not found, error " . $e->getMessage());
164 165
             return false;
165 166
         }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
 
78 78
     public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) : ?string
79 79
     {
80
-        if (   $object instanceof org_openpsa_contacts_group_dba
80
+        if ($object instanceof org_openpsa_contacts_group_dba
81 81
             || $object instanceof midcom_db_group) {
82 82
             return "group/{$object->guid}/";
83 83
         }
84
-        if (   $object instanceof org_openpsa_contacts_person_dba
84
+        if ($object instanceof org_openpsa_contacts_person_dba
85 85
             || $object instanceof midcom_db_person) {
86 86
             return "person/{$object->guid}/";
87 87
         }
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
             // We have a feed URL, but we should check if it is GeoRSS as well
111 111
             $items = net_nemein_rss_fetch::raw_fetch($data['rss_url'])->get_items();
112 112
 
113
-            if (   !empty($items)
114
-                && (   $items[0]->get_latitude()
113
+            if (!empty($items)
114
+                && ($items[0]->get_latitude()
115 115
                     || $items[0]->get_longitude())) {
116 116
                 // This is a GeoRSS feed
117 117
                 $data['georss_url'] = $data['rss_url'];
Please login to merge, or discard this patch.
lib/org/openpsa/reports/handler/invoices/report.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,8 @@
 block discarded – undo
114 114
                         && $deliverable->end > $this->_request_data['start'])) {
115 115
                     $invoices = array_merge($invoices, $this->_get_invoices_for_subscription($deliverable, $at_entry));
116 116
                 }
117
-            } catch (midcom_error $e) {
117
+            }
118
+            catch (midcom_error $e) {
118 119
             }
119 120
         }
120 121
         $invoices = array_merge($invoices, $this->_get_deliverable_invoices());
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
     private function _get_invoices_for_subscription(org_openpsa_sales_salesproject_deliverable_dba $deliverable, midcom_services_at_entry_dba $at_entry) : array
58 58
     {
59
-        if (   $deliverable->invoiceByActualUnits
59
+        if ($deliverable->invoiceByActualUnits
60 60
             && $at_entry->arguments['cycle'] > 1) {
61 61
             $months = midcom_baseclasses_components_configuration::get('org.openpsa.sales', 'config')->get('subscription_profit_months');
62 62
             $cutoff = (new DateTime)->modify('-' . $months . ' months');
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
         $time = $at_entry->start;
82 82
         $scheduler = new org_openpsa_invoices_scheduler($deliverable);
83 83
 
84
-        while (   $time < $this->_request_data['end']
85
-               && (   $time < $deliverable->end
84
+        while ($time < $this->_request_data['end']
85
+               && ($time < $deliverable->end
86 86
                    || $deliverable->continuous)) {
87 87
             $invoices[] = $this->get_invoice_for_deliverable($deliverable, $invoice_sum, $time, $calculation_base);
88 88
 
@@ -124,8 +124,8 @@  discard block
 block discarded – undo
124 124
         foreach ($qb->execute() as $at_entry) {
125 125
             try {
126 126
                 $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($at_entry->arguments['deliverable']);
127
-                if (   $deliverable->continuous
128
-                    || (   $deliverable->start < $this->_request_data['end']
127
+                if ($deliverable->continuous
128
+                    || ($deliverable->start < $this->_request_data['end']
129 129
                         && $deliverable->end > $this->_request_data['start'])) {
130 130
                     $invoices = array_merge($invoices, $this->_get_invoices_for_subscription($deliverable, $at_entry));
131 131
                 }
Please login to merge, or discard this patch.