@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | $this->object = $this->load_object($guid); |
48 | 48 | |
49 | - if ( !midcom::get()->config->get('midcom_services_rcs_enable') |
|
49 | + if (!midcom::get()->config->get('midcom_services_rcs_enable') |
|
50 | 50 | || !$this->object->_use_rcs) { |
51 | 51 | throw new midcom_error_notfound("Revision control not supported for " . $this->object::class . "."); |
52 | 52 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | throw new midcom_error_notfound("Revision {$args[1]} does not exist."); |
258 | 258 | } |
259 | 259 | |
260 | - $data['preview'] = array_filter($this->backend->get_revision($revision), function ($value, $key) { |
|
260 | + $data['preview'] = array_filter($this->backend->get_revision($revision), function($value, $key) { |
|
261 | 261 | return !is_array($value) |
262 | 262 | && !in_array($value, ['', '0000-00-00']) |
263 | 263 | && midcom_services_rcs::is_field_showable($key); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $this->object->require_do('midgard:update'); |
286 | 286 | // TODO: set another privilege for restoring? |
287 | 287 | |
288 | - if ( $this->backend->get_history()->version_exists($args[1]) |
|
288 | + if ($this->backend->get_history()->version_exists($args[1]) |
|
289 | 289 | && $this->backend->restore_to_revision($args[1])) { |
290 | 290 | midcom::get()->uimessages->add($this->_l10n->get('midcom.admin.rcs'), sprintf($this->_l10n->get('restore to version %s successful'), $args[1])); |
291 | 291 | return new midcom_response_relocate($this->get_object_url()); |
@@ -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 = $obj::class; |
67 | 67 | $link->toGuid = $obj->guid; |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | // Get the calendar root event |
26 | 26 | if (class_exists('org_openpsa_calendar_interface')) { |
27 | - $field =& $schemadb->get('default')->get_field('calendar'); |
|
27 | + $field = & $schemadb->get('default')->get_field('calendar'); |
|
28 | 28 | $field['type_config']['privilege_object'] = org_openpsa_calendar_interface::find_root_event(); |
29 | 29 | $field['type_config']['assignee'] = 'user:' . $person->guid; |
30 | 30 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | // Get the calendar root event |
26 | 26 | if (class_exists('org_openpsa_calendar_interface')) { |
27 | - $field =& $schemadb->get('default')->get_field('calendar'); |
|
27 | + $field = & $schemadb->get('default')->get_field('calendar'); |
|
28 | 28 | $field['type_config']['privilege_object'] = org_openpsa_calendar_interface::find_root_event(); |
29 | 29 | $field['type_config']['assignee'] = 'group:' . $group->guid; |
30 | 30 | } |
@@ -52,7 +52,8 @@ |
||
52 | 52 | try { |
53 | 53 | \midgard_object_class::get_object_by_guid($param->parentguid); |
54 | 54 | $seen[$param->parentguid] = true; |
55 | - } catch (\Throwable) { |
|
55 | + } |
|
56 | + catch (\Throwable) { |
|
56 | 57 | $seen[$param->parentguid] = false; |
57 | 58 | } |
58 | 59 | } |
@@ -62,7 +62,8 @@ |
||
62 | 62 | try { |
63 | 63 | \midgard_object_class::get_object_by_guid($priv->objectguid); |
64 | 64 | $seen_parents[$priv->objectguid] = true; |
65 | - } catch (\Throwable) { |
|
65 | + } |
|
66 | + catch (\Throwable) { |
|
66 | 67 | $seen_parents[$priv->objectguid] = false; |
67 | 68 | } |
68 | 69 | } |
@@ -104,7 +104,8 @@ |
||
104 | 104 | $qb->add_constraint("location", "=", $location); |
105 | 105 | try { |
106 | 106 | $attachments = $qb->execute(); |
107 | - } catch (\Exception) { |
|
107 | + } |
|
108 | + catch (\Exception) { |
|
108 | 109 | return null; |
109 | 110 | } |
110 | 111 | if (empty($attachments)) { |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | $this->_uncached = $config->get('cache_module_content_uncached'); |
143 | 143 | $this->_headers_strategy = $this->get_strategy('cache_module_content_headers_strategy'); |
144 | 144 | $this->_headers_strategy_authenticated = $this->get_strategy('cache_module_content_headers_strategy_authenticated'); |
145 | - $this->_default_lifetime = (int)$config->get('cache_module_content_default_lifetime'); |
|
146 | - $this->_default_lifetime_authenticated = (int)$config->get('cache_module_content_default_lifetime_authenticated'); |
|
145 | + $this->_default_lifetime = (int) $config->get('cache_module_content_default_lifetime'); |
|
146 | + $this->_default_lifetime_authenticated = (int) $config->get('cache_module_content_default_lifetime_authenticated'); |
|
147 | 147 | |
148 | 148 | if ($this->_headers_strategy == 'no-cache') { |
149 | 149 | // we can't call no_cache() here, because it would try to call back to this class via the global getter |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | */ |
509 | 509 | private function write_meta_cache(string $content_id, Request $request, Response $response) |
510 | 510 | { |
511 | - if ( $this->_uncached |
|
511 | + if ($this->_uncached |
|
512 | 512 | || $this->_no_cache) { |
513 | 513 | return; |
514 | 514 | } |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | |
574 | 574 | private function store_dl_content(Request $request, Response $response) |
575 | 575 | { |
576 | - if ( $this->_no_cache |
|
576 | + if ($this->_no_cache |
|
577 | 577 | || $this->_uncached) { |
578 | 578 | return; |
579 | 579 | } |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | |
616 | 616 | /* TODO: Doublecheck the way this is handled, now we just don't send it |
617 | 617 | * if headers_strategy implies caching */ |
618 | - if ( !$response->headers->has('Content-Length') |
|
618 | + if (!$response->headers->has('Content-Length') |
|
619 | 619 | && !in_array($this->_headers_strategy, ['public', 'private'])) { |
620 | 620 | $response->headers->set("Content-Length", strlen($response->getContent())); |
621 | 621 | } |
@@ -65,7 +65,8 @@ |
||
65 | 65 | $backend = $this->load_backend($object); |
66 | 66 | try { |
67 | 67 | $backend->update(midcom::get()->auth->user->id ?? 'NOBODY', $object->get_rcs_message()); |
68 | - } catch (midcom_error $e) { |
|
68 | + } |
|
69 | + catch (midcom_error $e) { |
|
69 | 70 | debug_add('RCS: Could not save file!'); |
70 | 71 | $e->log(); |
71 | 72 | } |