Passed
Push — master ( 8a97b6...459a10 )
by Andreas
18:46
created
lib/midcom/services/cache/module/content.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
         $this->_uncached = $config->get('cache_module_content_uncached');
164 164
         $this->_headers_strategy = $this->get_strategy('cache_module_content_headers_strategy');
165 165
         $this->_headers_strategy_authenticated = $this->get_strategy('cache_module_content_headers_strategy_authenticated');
166
-        $this->_default_lifetime = (int)$config->get('cache_module_content_default_lifetime');
167
-        $this->_default_lifetime_authenticated = (int)$config->get('cache_module_content_default_lifetime_authenticated');
166
+        $this->_default_lifetime = (int) $config->get('cache_module_content_default_lifetime');
167
+        $this->_default_lifetime_authenticated = (int) $config->get('cache_module_content_default_lifetime_authenticated');
168 168
 
169 169
         if ($this->_headers_strategy == 'no-cache') {
170 170
             // we can't call no_cache() here, because it would try to call back to this class via the global getter
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
      */
532 532
     public function write_meta_cache(string $content_id, Request $request, Response $response)
533 533
     {
534
-        if (   $this->_uncached
534
+        if ($this->_uncached
535 535
             || $this->_no_cache) {
536 536
             return;
537 537
         }
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 
594 594
     public function store_dl_content(int $context, string $dl_cache_data, Request $request)
595 595
     {
596
-        if (   $this->_no_cache
596
+        if ($this->_no_cache
597 597
             || $this->_uncached) {
598 598
             return;
599 599
         }
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 
628 628
         /* TODO: Doublecheck the way this is handled, now we just don't send it
629 629
          * if headers_strategy implies caching */
630
-        if (   !$response->headers->has('Content-Length')
630
+        if (!$response->headers->has('Content-Length')
631 631
             && !in_array($this->_headers_strategy, ['public', 'private'])) {
632 632
             $response->headers->set("Content-Length", strlen($response->getContent()));
633 633
         }
Please login to merge, or discard this patch.
lib/midcom/core/collector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
             if ($counter <= $this->_offset) {
143 143
                 continue;
144 144
             }
145
-            if (   $this->_limit
145
+            if ($this->_limit
146 146
                 && $counter > ($this->_offset + $this->_limit)) {
147 147
                 break;
148 148
             }
Please login to merge, or discard this patch.
lib/midcom/helper/reflector/tree.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
     private static function _check_permissions(bool $deleted) : bool
80 80
     {
81 81
         // PONDER: Check for some generic user privilege instead  ??
82
-        if (   $deleted
82
+        if ($deleted
83 83
             && !midcom::get()->auth->admin
84 84
             && !midcom::get()->auth->is_component_sudo()) {
85 85
             debug_add('Non-admins are not allowed to list deleted objects', MIDCOM_LOG_ERROR);
Please login to merge, or discard this patch.
lib/org/openpsa/relatedto/finder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             }
53 53
         }
54 54
 
55
-        if (   empty($link->toComponent)
55
+        if (empty($link->toComponent)
56 56
             && !empty($link->fromComponent)) {
57 57
             debug_add("Setting property 'toComponent' to '{$component}'");
58 58
             $link->toComponent = $component;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             $link->fromComponent = $component;
62 62
         }
63 63
 
64
-        if (   empty($link->toGuid)
64
+        if (empty($link->toGuid)
65 65
             && !empty($link->fromGuid)) {
66 66
             $link->toClass = get_class($obj);
67 67
             $link->toGuid = $obj->guid;
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/invoice.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -120,14 +120,16 @@
 block discarded – undo
120 120
         if (!empty($this->customer)) {
121 121
             try {
122 122
                 return org_openpsa_contacts_group_dba::get_cached($this->customer);
123
-            } catch (midcom_error $e) {
123
+            }
124
+            catch (midcom_error $e) {
124 125
                 $e->log();
125 126
             }
126 127
         }
127 128
         if (!empty($this->customerContact)) {
128 129
             try {
129 130
                 return org_openpsa_contacts_person_dba::get_cached($this->customerContact);
130
-            } catch (midcom_error $e) {
131
+            }
132
+            catch (midcom_error $e) {
131 133
                 $e->log();
132 134
             }
133 135
         }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                 $invoice_item->pricePerUnit = $deliverable->pricePerUnit;
209 209
                 $invoice_item->deliverable = $deliverable->id;
210 210
                 //calculate price
211
-                if (   $deliverable->invoiceByActualUnits
211
+                if ($deliverable->invoiceByActualUnits
212 212
                     || $deliverable->plannedUnits == 0) {
213 213
                     $invoice_item->units = $hours;
214 214
                 } else {
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      */
250 250
     public function get_billing_data() : org_openpsa_invoices_billing_data_dba
251 251
     {
252
-        return $this->_billing_data ??= org_openpsa_invoices_billing_data_dba::get_by_object($this);;
252
+        return $this->_billing_data ??= org_openpsa_invoices_billing_data_dba::get_by_object($this); ;
253 253
     }
254 254
 
255 255
     public function get_customer()
Please login to merge, or discard this patch.
lib/org/openpsa/expenses/hour/report.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,8 @@
 block discarded – undo
98 98
             if ($this->old_task) {
99 99
                 self::update_cache(new org_openpsa_projects_task_dba($this->old_task));
100 100
             }
101
-        } catch (midcom_error $e) {
101
+        }
102
+        catch (midcom_error $e) {
102 103
             $e->log();
103 104
         }
104 105
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
     {
114 114
         if ($this->invoiceable) {
115 115
             $task = new org_openpsa_projects_task_dba($this->task);
116
-            $time_slot = (float)$task->get_parameter('org.openpsa.projects.projectbroker', 'minimum_slot');
116
+            $time_slot = (float) $task->get_parameter('org.openpsa.projects.projectbroker', 'minimum_slot');
117 117
             if (empty($time_slot)) {
118 118
                 $time_slot = (float) midcom_baseclasses_components_configuration::get('org.openpsa.expenses', 'config')->get('default_minimum_time_slot');
119 119
                 if (empty($time_slot)) {
Please login to merge, or discard this patch.
lib/org/openpsa/expenses/midcom/interfaces.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@
 block discarded – undo
48 48
         foreach (array_unique($tasks_to_update) as $id) {
49 49
             try {
50 50
                 org_openpsa_expenses_hour_report_dba::update_cache(new org_openpsa_projects_task_dba($id));
51
-            } catch (midcom_error $e) {
51
+            }
52
+            catch (midcom_error $e) {
52 53
                 $e->log();
53 54
             }
54 55
         }
Please login to merge, or discard this patch.
lib/org/openpsa/sales/calculator/default.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
     private function get_units($units = false) : float
51 51
     {
52
-        if (   $this->deliverable->invoiceByActualUnits
52
+        if ($this->deliverable->invoiceByActualUnits
53 53
             || $this->deliverable->plannedUnits == 0) {
54 54
             // In most cases we calculate the price based on the actual units entered
55 55
             return $units ?: $this->deliverable->units;
Please login to merge, or discard this patch.
lib/org/openpsa/sales/salesproject/deliverable.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $this->calculate_price(false);
73 73
 
74
-        if (   $this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION
74
+        if ($this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION
75 75
             && $this->continuous) {
76 76
             $this->end = 0;
77 77
         } elseif ($this->end < $this->start) {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         $calculator->run($this);
139 139
         $cost = $calculator->get_cost();
140 140
         $price = $calculator->get_price();
141
-        if (   $price != $this->price
141
+        if ($price != $this->price
142 142
             || $cost != $this->cost) {
143 143
             $this->price = $price;
144 144
             $this->cost = $cost;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         $units = $hours['invoiceable'];
179 179
         $uninvoiceableUnits = $hours['reported'] - ($hours['invoiceable'] + $hours['invoiced']);
180 180
 
181
-        if (   $units != $this->units
181
+        if ($units != $this->units
182 182
             || $uninvoiceableUnits != $this->uninvoiceableUnits) {
183 183
             debug_add("agreement values have changed, setting units to " . $units . ", uninvoiceable: " . $uninvoiceableUnits);
184 184
             $this->units = $units;
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
                 break;
230 230
             case 'q':
231 231
                 // Quarterly recurring subscription
232
-                $identifier = ceil(((int)$date->format('n')) / 4) . 'Q' . $date->format('y');
232
+                $identifier = ceil(((int) $date->format('n')) / 4) . 'Q' . $date->format('y');
233 233
                 break;
234 234
             case 'hy':
235 235
                 // Half-yearly recurring subscription
236
-                $identifier = ceil(((int)$date->format('n')) / 6) . '/' . $date->format('Y');
236
+                $identifier = ceil(((int) $date->format('n')) / 6) . '/' . $date->format('Y');
237 237
                 break;
238 238
             case 'y':
239 239
                 // Yearly recurring subscription
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
     public function invoice() : bool
263 263
     {
264
-        if (   $this->state >= self::STATE_INVOICED
264
+        if ($this->state >= self::STATE_INVOICED
265 265
             || $this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION) {
266 266
             return false;
267 267
         }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
             midcom::get()->uimessages->add(midcom::get()->i18n->get_string('org.openpsa.sales', 'org.openpsa.sales'), sprintf(midcom::get()->i18n->get_string('marked deliverable "%s" delivered', 'org.openpsa.sales'), $this->title));
365 365
 
366 366
             // Check if we need to create task or ship goods
367
-            if (   $update_deliveries
367
+            if ($update_deliveries
368 368
                 && $product->orgOpenpsaObtype === org_openpsa_products_product_dba::TYPE_SERVICE) {
369 369
                 // Change status of tasks connected to the deliverable
370 370
                 $qb = org_openpsa_projects_task_dba::new_query_builder();
Please login to merge, or discard this patch.