@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function set_storage(?midcom_core_dbaobject $storage = null, ?string $schemaname = null) : self |
| 59 | 59 | { |
| 60 | - if ( $schemaname === null |
|
| 60 | + if ($schemaname === null |
|
| 61 | 61 | && !empty($storage->id)) { |
| 62 | 62 | $schemaname = $storage->get_parameter('midcom.helper.datamanager2', 'schema_name'); |
| 63 | 63 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $this->form = null; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - if ( $this->form === null |
|
| 149 | + if ($this->form === null |
|
| 150 | 150 | || ($name && $this->form->getName() != $name)) { |
| 151 | 151 | $this->build_form($this->get_builder($name)); |
| 152 | 152 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | { |
| 240 | 240 | $ret = true; |
| 241 | 241 | foreach ($this->storage as $field) { |
| 242 | - if ( $field instanceof recreateable |
|
| 242 | + if ($field instanceof recreateable |
|
| 243 | 243 | && !$field->recreate()) { |
| 244 | 244 | $ret = false; |
| 245 | 245 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function get_object_name(?string $name_property = null) : ?string |
| 33 | 33 | { |
| 34 | 34 | $name_property ??= midcom_helper_reflector::get_name_property($this->_object); |
| 35 | - if ( empty($name_property) |
|
| 35 | + if (empty($name_property) |
|
| 36 | 36 | || !midcom_helper_reflector::get($this->_object)->property_exists($name_property)) { |
| 37 | 37 | // Could not resolve valid property |
| 38 | 38 | return null; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | $qb->add_constraint($child_name_property, '=', $name); |
| 126 | 126 | if ($qb->count()) { |
| 127 | - 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, '/') . "')" ); |
|
| 127 | + 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, '/') . "')"); |
|
| 128 | 128 | return false; |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } while (!$this->name_is_unique()); |
| 200 | 200 | |
| 201 | 201 | // Get a copy of the current, usable name |
| 202 | - $ret = (string)$this->_object->{$name_prop}; |
|
| 202 | + $ret = (string) $this->_object->{$name_prop}; |
|
| 203 | 203 | // Restore the original name |
| 204 | 204 | $this->_object->{$name_prop} = $original_name; |
| 205 | 205 | return $ret; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | return true; |
| 204 | 204 | } |
| 205 | 205 | if ($user === null) { |
| 206 | - $user =& $this->user; |
|
| 206 | + $user = & $this->user; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | if ($user == 'EVERYONE') { |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | * |
| 275 | 275 | * It always returns true for administrative users. |
| 276 | 276 | */ |
| 277 | - public function is_group_member(midcom_core_group|string $group, ?midcom_core_user $user = null) : bool |
|
| 277 | + public function is_group_member(midcom_core_group | string $group, ?midcom_core_user $user = null) : bool |
|
| 278 | 278 | { |
| 279 | 279 | if ($this->is_admin($user)) { |
| 280 | 280 | // Administrators always have access. |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | * (group:...), any valid identifier for the midcom_core_group |
| 520 | 520 | * constructor or a valid object of that type. |
| 521 | 521 | */ |
| 522 | - public function get_group(string|int|midcom_db_group|midgard_group $id) : ?midcom_core_group |
|
| 522 | + public function get_group(string | int | midcom_db_group | midgard_group $id) : ?midcom_core_group |
|
| 523 | 523 | { |
| 524 | 524 | $param = $id; |
| 525 | 525 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | return "{$cacheroot}/{$subdir}/{$this->guid}/{$this->name}"; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - public static function get_url(midgard_attachment|midcom_db_attachment|string $attachment, ?string $name = null) : string |
|
| 158 | + public static function get_url(midgard_attachment | midcom_db_attachment | string $attachment, ?string $name = null) : string |
|
| 159 | 159 | { |
| 160 | 160 | if (is_string($attachment)) { |
| 161 | 161 | $guid = $attachment; |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | public function update_cache() |
| 302 | 302 | { |
| 303 | 303 | // Check if the attachment can be read anonymously |
| 304 | - if ( midcom::get()->config->get('attachment_cache_enabled') |
|
| 304 | + if (midcom::get()->config->get('attachment_cache_enabled') |
|
| 305 | 305 | && !$this->can_do('midgard:read', 'EVERYONE')) { |
| 306 | 306 | // Not public file, ensure it is removed |
| 307 | 307 | $this->remove_from_cache(); |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | |
| 60 | 60 | public function _handler_create(Request $request, array &$data, ?string $guid = null) |
| 61 | 61 | { |
| 62 | - midcom::get()->auth->require_user_do('org.openpsa.user:manage', class: org_openpsa_user_interface::class); |
|
| 62 | + midcom::get()->auth->require_user_do('org.openpsa.user:manage', class : org_openpsa_user_interface::class); |
|
| 63 | 63 | |
| 64 | 64 | if ($guid !== null) { |
| 65 | 65 | // Get the organization |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | public function _handler_create(Request $request, ?string $guid = null) |
| 23 | 23 | { |
| 24 | - midcom::get()->auth->require_user_do('midgard:create', class: org_openpsa_contacts_person_dba::class); |
|
| 24 | + midcom::get()->auth->require_user_do('midgard:create', class : org_openpsa_contacts_person_dba::class); |
|
| 25 | 25 | |
| 26 | 26 | $defaults = []; |
| 27 | 27 | if (!empty($guid)) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function _handler_new(Request $request, ?string $guid = null) |
| 39 | 39 | { |
| 40 | - midcom::get()->auth->require_user_do('midgard:create', class: org_openpsa_sales_salesproject_dba::class); |
|
| 40 | + midcom::get()->auth->require_user_do('midgard:create', class : org_openpsa_sales_salesproject_dba::class); |
|
| 41 | 41 | |
| 42 | 42 | $this->_salesproject = new org_openpsa_sales_salesproject_dba; |
| 43 | 43 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $schemadb = schemadb::from_path($this->_config->get('schemadb_salesproject')); |
| 49 | 49 | |
| 50 | 50 | if ($guid) { |
| 51 | - $field =& $schemadb->get('default')->get_field('customer'); |
|
| 51 | + $field = & $schemadb->get('default')->get_field('customer'); |
|
| 52 | 52 | try { |
| 53 | 53 | $customer = new org_openpsa_contacts_group_dba($guid); |
| 54 | 54 | $field['type_config']['options'] = [0 => '', $customer->id => $customer->official]; |