@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $localpath = $path; |
| 151 | 151 | $matches['latest_parent'] = $folder_tree['/']; |
| 152 | 152 | $missing_levels = 0; |
| 153 | - while ( $localpath |
|
| 153 | + while ($localpath |
|
| 154 | 154 | && $localpath != '/') { |
| 155 | 155 | $localpath = dirname($localpath); |
| 156 | 156 | $missing_levels++; |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | $root_folder = $folder; |
| 179 | 179 | $max = 100; |
| 180 | - while ( $folder[MIDCOM_NAV_COMPONENT] == 'net.nemein.wiki' |
|
| 180 | + while ($folder[MIDCOM_NAV_COMPONENT] == 'net.nemein.wiki' |
|
| 181 | 181 | && (($parent = $folder[MIDCOM_NAV_NODEID]) != -1) |
| 182 | 182 | && $max > 0) { |
| 183 | 183 | $root_folder = $folder; |
@@ -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]); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | if ($object instanceof midcom_db_topic) { |
| 104 | 104 | return $nav->get_node($object->id); |
| 105 | 105 | } |
| 106 | - if ( ($node = $nav->find_closest_topic($object)) |
|
| 106 | + if (($node = $nav->find_closest_topic($object)) |
|
| 107 | 107 | && $nodeobject = $nav->get_node($node->id)) { |
| 108 | 108 | return $nav->get_leaf($nodeobject[MIDCOM_NAV_ID] . '-' . $object->id); |
| 109 | 109 | } |
@@ -113,7 +113,7 @@ |
||
| 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)) { |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | public function configureOptions(OptionsResolver $resolver) |
| 34 | 34 | { |
| 35 | 35 | $resolver->setDefault('error_bubbling', false); |
| 36 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
| 36 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
| 37 | 37 | $widget_defaults = [ |
| 38 | 38 | 'creation_mode_enabled' => false, |
| 39 | 39 | 'class' => null, |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | return helper::normalize($widget_defaults, $value); |
| 68 | 68 | }); |
| 69 | - $resolver->setNormalizer('type_config', function (Options $options, $value) { |
|
| 69 | + $resolver->setNormalizer('type_config', function(Options $options, $value) { |
|
| 70 | 70 | $type_defaults = [ |
| 71 | 71 | 'options' => [], |
| 72 | 72 | 'method' => 'GET', |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | public function finishView(FormView $view, FormInterface $form, array $options) |
| 109 | 109 | { |
| 110 | 110 | $preset = []; |
| 111 | - if ( !empty($view->children['selection']->vars['data']) |
|
| 111 | + if (!empty($view->children['selection']->vars['data']) |
|
| 112 | 112 | && !empty($options['widget_config']['class'])) { |
| 113 | 113 | foreach (array_filter((array) $view->children['selection']->vars['data']) as $identifier) { |
| 114 | 114 | if ($options['widget_config']['id_field'] == 'id') { |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | ]) |
| 88 | 88 | ->setRequired('object') |
| 89 | 89 | ->setAllowedTypes('object', midcom_core_dbaobject::class) |
| 90 | - ->setNormalizer('label', function ($options, $value) { |
|
| 90 | + ->setNormalizer('label', function($options, $value) { |
|
| 91 | 91 | return $value ?? midcom_helper_reflector::get_object_title($options['object']); |
| 92 | 92 | }); |
| 93 | 93 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $this->_object = midcom::get()->dbfactory->get_object_by_guid($guid); |
| 29 | 29 | |
| 30 | - if ( !($this->_object instanceof midcom_db_topic) |
|
| 30 | + if (!($this->_object instanceof midcom_db_topic) |
|
| 31 | 31 | && !($this->_object instanceof midcom_db_article)) { |
| 32 | 32 | throw new midcom_error_notfound("Moving only topics and articles is supported."); |
| 33 | 33 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | $folder ??= midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ROOTTOPIC); |
| 68 | 68 | |
| 69 | - if ( $this->_object instanceof midcom_db_topic |
|
| 69 | + if ($this->_object instanceof midcom_db_topic |
|
| 70 | 70 | && $folder->up == $this->_object->id) { |
| 71 | 71 | $tree_disabled = true; |
| 72 | 72 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $selected = ' checked="checked"'; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - if ( !($this->_object instanceof midcom_db_topic) |
|
| 82 | + if (!($this->_object instanceof midcom_db_topic) |
|
| 83 | 83 | && $folder->component !== $this->current_folder->component) { |
| 84 | 84 | // Non-topic objects may only be moved under folders of same component |
| 85 | 85 | $class = 'wrong_component'; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $event ??= new org_openpsa_calendar_event_dba($this->eid); |
| 68 | 68 | |
| 69 | - if ( $recipient->id == midcom_connection::get_user() |
|
| 69 | + if ($recipient->id == midcom_connection::get_user() |
|
| 70 | 70 | && !$event->send_notify_me) { |
| 71 | 71 | //Do not send notification to current user |
| 72 | 72 | debug_add('event->send_notify_me is false and recipient is current user, aborting notify'); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | |
| 193 | 193 | if (isset($events_by_date[$ymd])) { |
| 194 | 194 | foreach ($events_by_date[$ymd] as $event) { |
| 195 | - if ( $event->end <= $workday_starts_ts |
|
| 195 | + if ($event->end <= $workday_starts_ts |
|
| 196 | 196 | || $event->start >= $workday_ends_ts) { |
| 197 | 197 | // We need not consider this event, it is outside the defined workday |
| 198 | 198 | continue; |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | // End of day slot |
| 213 | - if ( $last_end_time < $workday_ends_ts |
|
| 213 | + if ($last_end_time < $workday_ends_ts |
|
| 214 | 214 | && (($workday_ends_ts - $last_end_time) >= $amount)) { |
| 215 | 215 | $slots[] = self::_create_slot($last_end_time, $workday_ends_ts, $last_event); |
| 216 | 216 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | return $this->render_link($parts[1], $parts[2]) . $after; |
| 220 | 220 | |
| 221 | 221 | // Macro [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>]) |
| 222 | - case ( preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
| 222 | + case (preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
| 223 | 223 | && method_exists($this, "_run_macro_{$macro_parts[1]}")): |
| 224 | 224 | $method = "_run_macro_{$macro_parts[1]}"; |
| 225 | 225 | return $this->$method($macro_parts[2], $match[0], $after); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | // No page matched, link to creation |
| 248 | 248 | $folder = $wikipage_match['folder'] ?? $wikipage_match['latest_parent']; |
| 249 | 249 | |
| 250 | - if ( isset($folder[MIDCOM_NAV_OBJECT]) |
|
| 250 | + if (isset($folder[MIDCOM_NAV_OBJECT]) |
|
| 251 | 251 | && $folder[MIDCOM_NAV_OBJECT]->can_do('midgard:create')) { |
| 252 | 252 | $workflow = $this->get_workflow('datamanager'); |
| 253 | 253 | return "<a href=\"{$folder[MIDCOM_NAV_ABSOLUTEURL]}create/?wikiword={$wikipage_match['remaining_path']}\" " . $workflow->render_attributes() . " class=\"wiki_missing\" title=\"" . $this->_l10n->get('click to create') . "\">{$text}</a>"; |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $links[$parts[1]] = $parts[2]; |
| 283 | 283 | } |
| 284 | 284 | // Ignore macros [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>]) |
| 285 | - elseif ( !preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
| 285 | + elseif (!preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts) |
|
| 286 | 286 | || !method_exists($this, "_run_macro_{$macro_parts[1]}")) { |
| 287 | 287 | // MediaWiki-style link [wikipage] (no text) |
| 288 | 288 | $links[$fulltext] = $fulltext; |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | midcom::get()->metadata->set_request_metadata($this->_topic->metadata->revised, $this->_topic->guid); |
| 25 | 25 | $data['node'] = $this->_topic; |
| 26 | 26 | |
| 27 | - if ( $this->_topic->id == midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ROOTTOPIC)->id |
|
| 27 | + if ($this->_topic->id == midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ROOTTOPIC)->id |
|
| 28 | 28 | && !midcom::get()->config->get('midcom_root_component')) { |
| 29 | 29 | // if we have an ad hoc root topic, give user some options to do the initial setup |
| 30 | 30 | return new midcom_response_relocate($this->router->generate('wizard')); |