@@ -138,7 +138,7 @@ |
||
138 | 138 | $prefix = $this->context->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); |
139 | 139 | |
140 | 140 | // Check if we need to start up a plugin. |
141 | - if ( count($argv) > 1 |
|
141 | + if (count($argv) > 1 |
|
142 | 142 | && $config = plugin::get_config($argv[0], $argv[1])) { |
143 | 143 | $namespace = array_shift($argv); |
144 | 144 | $name = array_shift($argv); |
@@ -86,7 +86,7 @@ |
||
86 | 86 | require $basedir . $file; |
87 | 87 | } |
88 | 88 | |
89 | - midcom::get()->auth->drop_sudo();# |
|
89 | + midcom::get()->auth->drop_sudo(); # |
|
90 | 90 | return 0; |
91 | 91 | } |
92 | 92 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | public function _on_loaded() |
34 | 34 | { |
35 | 35 | // if we are missing the component, use the nullcomponent. |
36 | - if ( !$this->component |
|
36 | + if (!$this->component |
|
37 | 37 | || !midcom::get()->componentloader->is_installed($this->component)) { |
38 | 38 | debug_add("Topic {$this->id} has no component assigned to it, using 'midcom.core.nullcomponent'.", |
39 | 39 | MIDCOM_LOG_INFO); |
@@ -101,7 +101,7 @@ |
||
101 | 101 | $rawdata = base64_decode($request->cookies->get('midcom_services_i18n')); |
102 | 102 | $array = unserialize($rawdata); |
103 | 103 | |
104 | - if ( !array_key_exists('language', $array) |
|
104 | + if (!array_key_exists('language', $array) |
|
105 | 105 | || !array_key_exists('charset', $array)) { |
106 | 106 | debug_add("Rejecting cookie, it seems invalid."); |
107 | 107 | return false; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $images = $qb->execute(); |
62 | 62 | $failed = 0; |
63 | 63 | foreach ($images as $image) { |
64 | - if ( !$image->generate_image('thumbnail', $this->_config->get('thumbnail_filter')) |
|
64 | + if (!$image->generate_image('thumbnail', $this->_config->get('thumbnail_filter')) |
|
65 | 65 | || !$image->generate_image('image', $this->_config->get('image_filter'))) { |
66 | 66 | $failed++; |
67 | 67 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $attachment->title = $title; |
242 | 242 | $attachment->mimetype = $file['type']; |
243 | 243 | $attachment->parentguid = $image->guid; |
244 | - if ( !$attachment->create() |
|
244 | + if (!$attachment->create() |
|
245 | 245 | || !$attachment->copy_from_file($file['tmp_name'])) { |
246 | 246 | throw new midcom_error('Failed to create attachment: ' . midcom_connection::get_error_string()); |
247 | 247 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | if ($name_property === null) { |
37 | 37 | $name_property = midcom_helper_reflector::get_name_property($this->_object); |
38 | 38 | } |
39 | - if ( empty($name_property) |
|
39 | + if (empty($name_property) |
|
40 | 40 | || !midcom_helper_reflector::get($this->_object)->property_exists($name_property)) { |
41 | 41 | // Could not resolve valid property |
42 | 42 | return null; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | $qb->add_constraint($child_name_property, '=', $name); |
134 | 134 | if ($qb->count()) { |
135 | - debug_add("Name clash in sibling class {$schema_type} for " . get_class($this->_object) . " #{$this->_object->id} (path '" . midcom_helper_reflector_tree::resolve_path($this->_object, '/') . "')" ); |
|
135 | + debug_add("Name clash in sibling class {$schema_type} for " . get_class($this->_object) . " #{$this->_object->id} (path '" . midcom_helper_reflector_tree::resolve_path($this->_object, '/') . "')"); |
|
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } while (!$this->name_is_unique()); |
210 | 210 | |
211 | 211 | // Get a copy of the current, usable name |
212 | - $ret = (string)$this->_object->{$name_prop}; |
|
212 | + $ret = (string) $this->_object->{$name_prop}; |
|
213 | 213 | // Restore the original name |
214 | 214 | $this->_object->{$name_prop} = $original_name; |
215 | 215 | return $ret; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | private static function _check_permissions(bool $deleted) : bool |
124 | 124 | { |
125 | 125 | // PONDER: Check for some generic user privilege instead ?? |
126 | - if ( $deleted |
|
126 | + if ($deleted |
|
127 | 127 | && !midcom_connection::is_admin() |
128 | 128 | && !midcom::get()->auth->is_component_sudo()) { |
129 | 129 | debug_add('Non-admins are not allowed to list deleted objects', MIDCOM_LOG_ERROR); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | 'target' => $ref->get_link_target($field) |
208 | 208 | ]; |
209 | 209 | $linked_class = $ref->get_link_name($field); |
210 | - if ( empty($linked_class) |
|
210 | + if (empty($linked_class) |
|
211 | 211 | && $info['type'] === MGD_TYPE_GUID) { |
212 | 212 | // Guid link without class specification, valid for all classes |
213 | 213 | if (empty($info['target'])) { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $field_type = $field_data['type']; |
258 | 258 | $field = $field_data['name']; |
259 | 259 | |
260 | - if ( !$field_target |
|
260 | + if (!$field_target |
|
261 | 261 | || !isset($for_object->$field_target)) { |
262 | 262 | // Why return false ??? |
263 | 263 | return false; |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $parent_property = midgard_object_class::get_property_parent($schema_type); |
370 | 370 | $up_property = midgard_object_class::get_property_up($schema_type); |
371 | 371 | |
372 | - if ( $this->is_link_to_current_class($parent_property, $schema_type) |
|
372 | + if ($this->is_link_to_current_class($parent_property, $schema_type) |
|
373 | 373 | || $this->is_link_to_current_class($up_property, $schema_type)) { |
374 | 374 | $child_classes[] = $schema_type; |
375 | 375 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | $ref = new midgard_reflection_property($prospect_type); |
393 | 393 | $link_class = $ref->get_link_name($property); |
394 | - if ( empty($link_class) |
|
394 | + if (empty($link_class) |
|
395 | 395 | && $ref->get_midgard_type($property) === MGD_TYPE_GUID) { |
396 | 396 | return true; |
397 | 397 | } |
@@ -97,7 +97,7 @@ |
||
97 | 97 | $loader->load($this->getProjectDir() . '/config/services.yml'); |
98 | 98 | } |
99 | 99 | if ($classes = midcom::get_registered_service_classes()) { |
100 | - $loader->load(function (ContainerBuilder $container) use ($classes) { |
|
100 | + $loader->load(function(ContainerBuilder $container) use ($classes) { |
|
101 | 101 | foreach ($classes as $id => $class) { |
102 | 102 | $container->findDefinition($id)->setClass($class); |
103 | 103 | } |
@@ -152,7 +152,7 @@ |
||
152 | 152 | $preparsed = midcom_helper_formatter::compile($style); |
153 | 153 | |
154 | 154 | if (midcom_core_context::get()->has_custom_key('request_data')) { |
155 | - $data =& midcom_core_context::get()->get_custom_key('request_data'); |
|
155 | + $data = & midcom_core_context::get()->get_custom_key('request_data'); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | try { |