@@ -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]; |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | return new midcom_response_relocate($relocate); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - private function parse_input(ParameterBag $input, string $action) : int|bool |
|
| 136 | + private function parse_input(ParameterBag $input, string $action) : int | bool |
|
| 137 | 137 | { |
| 138 | 138 | if (!in_array($action, ['invoiceable', 'invoice', 'task'])) { |
| 139 | 139 | throw new midcom_error('passed action ' . $action . ' is unknown'); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | if ($contacts = $importer->parse($input)) { |
| 140 | 140 | $this->_request_data['import_status'] = $importer->import_subscribers($contacts, $this->_request_data['campaign']); |
| 141 | - if ( $this->_request_data['import_status']['subscribed_new'] > 0 |
|
| 141 | + if ($this->_request_data['import_status']['subscribed_new'] > 0 |
|
| 142 | 142 | || $this->_request_data['import_status']['already_subscribed'] > 0) { |
| 143 | 143 | $this->_import_success = true; |
| 144 | 144 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $read_rows = 0; |
| 196 | 196 | $handle = fopen($data['tmp_file'], 'r'); |
| 197 | 197 | $total_columns = 0; |
| 198 | - while ( $read_rows < 2 |
|
| 198 | + while ($read_rows < 2 |
|
| 199 | 199 | && $csv_line = fgetcsv($handle, 1000, $data['separator'])) { |
| 200 | 200 | if ($total_columns == 0) { |
| 201 | 201 | $total_columns = count($csv_line); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | $result = $this->validate_units($fields); |
| 19 | 19 | |
| 20 | - if ( empty($fields['end']) |
|
| 20 | + if (empty($fields['end']) |
|
| 21 | 21 | && empty($fields['continuous'])) { |
| 22 | 22 | if ($result === true) { |
| 23 | 23 | $result = []; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | public function validate_units(array $fields) |
| 31 | 31 | { |
| 32 | - if ( empty($fields['invoiceByActualUnits']) |
|
| 32 | + if (empty($fields['invoiceByActualUnits']) |
|
| 33 | 33 | && empty($fields['plannedUnits'])) { |
| 34 | 34 | return [ |
| 35 | 35 | 'plannedUnits' => midcom::get()->i18n->get_string('select either planned units or invoice by actual units', 'org.openpsa.sales') |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $schema->get_field('next_cycle')['hidden'] = false; |
| 38 | 38 | $schema->get_field('next_cycle')['default'] = $entry->start; |
| 39 | 39 | $schema->get_field('at_entry')['default'] = $entry->id; |
| 40 | - } elseif ( ($this->_deliverable->continuous || $this->_deliverable->end > time()) |
|
| 40 | + } elseif (($this->_deliverable->continuous || $this->_deliverable->end > time()) |
|
| 41 | 41 | && $this->_deliverable->state == org_openpsa_sales_salesproject_deliverable_dba::STATE_STARTED) { |
| 42 | 42 | $schema->get_field('next_cycle')['hidden'] = false; |
| 43 | 43 | } |