@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | if ($path === '') { |
66 | 66 | // Infinite loop, set an UI message and stop executing |
67 | - if ( !isset($schema['extends']['name']) |
|
67 | + if (!isset($schema['extends']['name']) |
|
68 | 68 | || $schema['extends']['name'] === $schema_name) { |
69 | 69 | throw new midcom_error('schema ' . $schema_name . ' extends itself'); |
70 | 70 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function _on_creating() : bool |
27 | 27 | { |
28 | - if ( !$this->referrer |
|
28 | + if (!$this->referrer |
|
29 | 29 | && !empty($_SERVER['HTTP_REFERER'])) { |
30 | 30 | $this->referrer = $_SERVER['HTTP_REFERER']; |
31 | 31 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | public function _on_creating() : bool |
42 | 42 | { |
43 | - return ( $this->validate_tag($this->tag) |
|
43 | + return ($this->validate_tag($this->tag) |
|
44 | 44 | && $this->_check_duplicates() == 0); |
45 | 45 | } |
46 | 46 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | public function _on_updating() : bool |
71 | 71 | { |
72 | - return ( $this->validate_tag($this->tag) |
|
72 | + return ($this->validate_tag($this->tag) |
|
73 | 73 | && $this->_check_duplicates() == 0); |
74 | 74 | } |
75 | 75 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $this->save_attachment_list(); |
57 | 57 | } |
58 | 58 | |
59 | - if ( array_intersect_key(array_flip(['description', 'title', 'score']), $this->value) |
|
59 | + if (array_intersect_key(array_flip(['description', 'title', 'score']), $this->value) |
|
60 | 60 | && $main = $this->get_main()) { |
61 | 61 | $needs_update = false; |
62 | 62 | if (array_key_exists('description', $this->value)) { |
@@ -163,8 +163,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -142,7 +142,7 @@ |
||
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 | } |
@@ -79,7 +79,7 @@ |
||
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); |
@@ -52,7 +52,7 @@ discard block |
||
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 |
||
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; |
@@ -120,14 +120,16 @@ |
||
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 | } |
@@ -208,7 +208,7 @@ discard block |
||
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 |
||
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() |