@@ -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 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | public function _on_creating() : bool |
30 | 30 | { |
31 | - if ( $this->title == '' |
|
31 | + if ($this->title == '' |
|
32 | 32 | || !$this->topic) { |
33 | 33 | // We must have wikiword and topic at this stage |
34 | 34 | return false; |
@@ -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)) { |
@@ -88,7 +88,7 @@ |
||
88 | 88 | return; |
89 | 89 | } |
90 | 90 | |
91 | - $project = new org_openpsa_projects_project($task->project); |
|
91 | + $project = new org_openpsa_projects_project($task->project); |
|
92 | 92 | |
93 | 93 | $qb = org_openpsa_contacts_role_dba::new_query_builder(); |
94 | 94 | $qb->add_constraint('person', '=', $this->person); |
@@ -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 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // Get parent from DB and compare to catch moves |
55 | 55 | if ($parent = $napobject[MIDCOM_NAV_OBJECT]->get_parent()) { |
56 | 56 | $parent_entry = $this->get_guid($parent->guid); |
57 | - if ( $parent_entry |
|
57 | + if ($parent_entry |
|
58 | 58 | && $parent_entry[MIDCOM_NAV_ID] != $cached_node_id) { |
59 | 59 | $this->backend->deleteItem($parent_entry[MIDCOM_NAV_ID] . '-leaves'); |
60 | 60 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $parent_id = $napobject[MIDCOM_NAV_NODEID]; |
70 | 70 | $parent_entry = $this->get_node($parent_id); |
71 | 71 | |
72 | - if ( $parent_entry |
|
72 | + if ($parent_entry |
|
73 | 73 | && array_key_exists(MIDCOM_NAV_SUBNODES, $parent_entry)) { |
74 | 74 | unset($parent_entry[MIDCOM_NAV_SUBNODES]); |
75 | 75 | $this->put_node($parent_id, $parent_entry); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if ($parent = $napobject[MIDCOM_NAV_OBJECT]->get_parent()) { |
80 | 80 | $parent_entry_from_object = $this->get_guid($parent->guid); |
81 | 81 | |
82 | - if ( !empty($parent_entry_from_object[MIDCOM_NAV_ID]) |
|
82 | + if (!empty($parent_entry_from_object[MIDCOM_NAV_ID]) |
|
83 | 83 | && !empty($parent_entry[MIDCOM_NAV_ID]) |
84 | 84 | && $parent_entry_from_object[MIDCOM_NAV_ID] != $parent_entry[MIDCOM_NAV_ID]) { |
85 | 85 | unset($parent_entry_from_object[MIDCOM_NAV_SUBNODES]); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $nav = new midcom_helper_nav; |
106 | 106 | if ($object instanceof midcom_db_topic) { |
107 | 107 | $napobject = $nav->get_node($object->id); |
108 | - } elseif ( ($node = $nav->find_closest_topic($object)) |
|
108 | + } elseif (($node = $nav->find_closest_topic($object)) |
|
109 | 109 | && $nodeobject = $nav->get_node($node->id)) { |
110 | 110 | $napobject = $nav->get_leaf($nodeobject[MIDCOM_NAV_ID] . '-' . $object->id); |
111 | 111 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $this->calculate_price(false); |
80 | 80 | |
81 | - if ( $this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
81 | + if ($this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
82 | 82 | && $this->continuous) { |
83 | 83 | $this->end = 0; |
84 | 84 | } elseif ($this->end < $this->start) { |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $calculator->run($this); |
167 | 167 | $cost = $calculator->get_cost(); |
168 | 168 | $price = $calculator->get_price(); |
169 | - if ( $price != $this->price |
|
169 | + if ($price != $this->price |
|
170 | 170 | || $cost != $this->cost) { |
171 | 171 | $this->price = $price; |
172 | 172 | $this->cost = $cost; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $units = $agreement_hours['invoiceable']; |
214 | 214 | $uninvoiceableUnits = $agreement_hours['reported'] - ($agreement_hours['invoiceable'] + $agreement_hours['invoiced']); |
215 | 215 | |
216 | - if ( $units != $this->units |
|
216 | + if ($units != $this->units |
|
217 | 217 | || $uninvoiceableUnits != $this->uninvoiceableUnits) { |
218 | 218 | debug_add("agreement values have changed, setting units to " . $units . ", uninvoiceable: " . $uninvoiceableUnits); |
219 | 219 | $this->units = $units; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | public function invoice() : bool |
269 | 269 | { |
270 | - if ( $this->state >= self::STATE_INVOICED |
|
270 | + if ($this->state >= self::STATE_INVOICED |
|
271 | 271 | || $this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION) { |
272 | 272 | return false; |
273 | 273 | } |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | 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)); |
371 | 371 | |
372 | 372 | // Check if we need to create task or ship goods |
373 | - if ( $update_deliveries |
|
373 | + if ($update_deliveries |
|
374 | 374 | && $product->orgOpenpsaObtype === org_openpsa_products_product_dba::TYPE_SERVICE) { |
375 | 375 | // Change status of tasks connected to the deliverable |
376 | 376 | $qb = org_openpsa_projects_task_dba::new_query_builder(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $reindex_topic_uri = midcom::get()->get_page_prefix() . 'midcom-exec-midcom/reindex_singlenode.php'; |
48 | 48 | |
49 | 49 | $options = ['timeout' => 300]; |
50 | -if ( !empty($_SERVER['PHP_AUTH_USER']) |
|
50 | +if (!empty($_SERVER['PHP_AUTH_USER']) |
|
51 | 51 | && !empty($_SERVER['PHP_AUTH_PW'])) { |
52 | 52 | $options['auth'] = ['user' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP_AUTH_PW']]; |
53 | 53 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } else { |
66 | 66 | echo "OK.\n"; |
67 | 67 | } |
68 | - }, function (TransferException $e) use ($uri) { |
|
68 | + }, function(TransferException $e) use ($uri) { |
|
69 | 69 | echo "failure.\n Background processing failed, error: {$e->getMessage()}\n"; |
70 | 70 | echo "Url: " . $uri . "\n"; |
71 | 71 | })->wait(); |