@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if ( empty($input) |
|
| 37 | - || ( $input instanceof DateTime |
|
| 36 | + if (empty($input) |
|
| 37 | + || ($input instanceof DateTime |
|
| 38 | 38 | && $input->format('Y-m-d H:i:s') == '0001-01-01 00:00:00')) { |
| 39 | 39 | return $result; |
| 40 | 40 | } |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | throw new TransformationFailedException('Expected an array.'); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if ( empty($array['date']) |
|
| 63 | - || ( $array['date'] instanceof DateTime |
|
| 62 | + if (empty($array['date']) |
|
| 63 | + || ($array['date'] instanceof DateTime |
|
| 64 | 64 | && $array['date']->format('Y-m-d H:i:s') == '0001-01-01 00:00:00')) { |
| 65 | 65 | return; |
| 66 | 66 | } |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | $this->_inheritance_chains = []; |
| 359 | 359 | |
| 360 | 360 | foreach ($this->_direct_groups as $id => $group) { |
| 361 | - $this->_all_groups[$id] =& $this->_direct_groups[$id]; |
|
| 361 | + $this->_all_groups[$id] = & $this->_direct_groups[$id]; |
|
| 362 | 362 | $inheritance_chain = [$group->id]; |
| 363 | 363 | /** |
| 364 | 364 | * FIXME: Parent group members should inherit permissions from |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | |
| 533 | 533 | $timeout = midcom::get()->config->get('auth_login_session_timeout', 0); |
| 534 | 534 | $last_seen = $person->get_parameter('midcom', 'online'); |
| 535 | - if ( !$last_seen |
|
| 535 | + if (!$last_seen |
|
| 536 | 536 | || ($timeout > 0 && time() - $timeout > $last_seen)) { |
| 537 | 537 | return 'offline'; |
| 538 | 538 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function purify_content(FormEvent $event) |
| 42 | 42 | { |
| 43 | - if ( isset($this->config['Cache']['SerializerPath']) |
|
| 43 | + if (isset($this->config['Cache']['SerializerPath']) |
|
| 44 | 44 | && !file_exists($this->config['Cache']['SerializerPath'])) { |
| 45 | 45 | mkdir($this->config['Cache']['SerializerPath']); |
| 46 | 46 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | // Load custom element/attribute definitions |
| 56 | 56 | $definitions = $this->get_from_global_config('html_purify_HTMLDefinition'); |
| 57 | - if ( !empty($definitions) |
|
| 57 | + if (!empty($definitions) |
|
| 58 | 58 | && $def = $purifier_config->maybeGetRawHTMLDefinition()) { |
| 59 | 59 | if (!empty($definitions['addAttribute'])) { |
| 60 | 60 | foreach (array_filter((array) $definitions['addAttribute'], 'is_array') as $attrdef) { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | // TODO: Warehouse management: create new order |
| 97 | - if ( $this->_deliverable->end < $next_cycle_start |
|
| 97 | + if ($this->_deliverable->end < $next_cycle_start |
|
| 98 | 98 | && $this->_deliverable->end != 0) { |
| 99 | 99 | debug_add('Do not register next cycle, the contract ends before'); |
| 100 | 100 | return $this->_deliverable->end_subscription(); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | //If previous cycle was run at the end of the month, the new one should be at the end of the month as well |
| 315 | 315 | $date = new DateTime(gmdate('Y-m-d', $time), new DateTimeZone('GMT')); |
| 316 | - if ( $date->format('t') == $date->format('j') |
|
| 316 | + if ($date->format('t') == $date->format('j') |
|
| 317 | 317 | && $new_date->format('t') != $new_date->format('j')) { |
| 318 | 318 | $new_date->setDate((int) $new_date->format('Y'), (int) $new_date->format('m'), (int) $new_date->format('t')); |
| 319 | 319 | } |
@@ -373,11 +373,11 @@ discard block |
||
| 373 | 373 | break; |
| 374 | 374 | case 'q': |
| 375 | 375 | // Quarterly recurring subscription |
| 376 | - $identifier = ceil(((int)$date->format('n')) / 4) . 'Q' . $date->format('y'); |
|
| 376 | + $identifier = ceil(((int) $date->format('n')) / 4) . 'Q' . $date->format('y'); |
|
| 377 | 377 | break; |
| 378 | 378 | case 'hy': |
| 379 | 379 | // Half-yearly recurring subscription |
| 380 | - $identifier = ceil(((int)$date->format('n')) / 6) . '/' . $date->format('Y'); |
|
| 380 | + $identifier = ceil(((int) $date->format('n')) / 6) . '/' . $date->format('Y'); |
|
| 381 | 381 | break; |
| 382 | 382 | case 'y': |
| 383 | 383 | // Yearly recurring subscription |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | <th><?php echo $data['l10n']->get('type'); ?></th> |
| 24 | 24 | <?php |
| 25 | 25 | } ?> |
| 26 | -<?php if ( array_key_exists('invoiceable_filter', $query_data)) { |
|
| 26 | +<?php if (array_key_exists('invoiceable_filter', $query_data)) { |
|
| 27 | 27 | ?> |
| 28 | 28 | <th><?php echo midcom::get()->i18n->get_string('invoiceable', 'org.openpsa.projects'); ?></th> |
| 29 | 29 | <?php |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $at_entries = $mc->get_related_objects(); |
| 41 | 41 | |
| 42 | 42 | if (empty($at_entries)) { |
| 43 | - if ( ( $this->_deliverable->continuous |
|
| 43 | + if (($this->_deliverable->continuous |
|
| 44 | 44 | || $this->_deliverable->end > time()) |
| 45 | 45 | && $this->_deliverable->state == org_openpsa_sales_salesproject_deliverable_dba::STATE_STARTED) { |
| 46 | 46 | $schema->get_field('next_cycle')['hidden'] = false; |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | ]) |
| 89 | 89 | ->setRequired('object') |
| 90 | 90 | ->setAllowedTypes('object', midcom_core_dbaobject::class) |
| 91 | - ->setNormalizer('label', function ($options, $value) { |
|
| 91 | + ->setNormalizer('label', function($options, $value) { |
|
| 92 | 92 | if ($value === null) { |
| 93 | 93 | return midcom_helper_reflector::get_object_title($options['object']); |
| 94 | 94 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | return null; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if (! $input instanceof midcom_db_attachment) { |
|
| 33 | + if (!$input instanceof midcom_db_attachment) { |
|
| 34 | 34 | throw new UnexpectedTypeException($input, midcom_db_attachment::class); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | 'customdata' => [] |
| 161 | 161 | ], $config)); |
| 162 | 162 | |
| 163 | - $normalize_widget = function (Options $options, $value) { |
|
| 163 | + $normalize_widget = function(Options $options, $value) { |
|
| 164 | 164 | if ($value == 'text') { |
| 165 | 165 | if (!empty($options['widget_config']['hideinput'])) { |
| 166 | 166 | return PasswordType::class; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | return $value; |
| 186 | 186 | }; |
| 187 | 187 | |
| 188 | - $normalize_storage = function (Options $options, $value) use ($name) { |
|
| 188 | + $normalize_storage = function(Options $options, $value) use ($name) { |
|
| 189 | 189 | $default = [ |
| 190 | 190 | 'location' => 'parameter', |
| 191 | 191 | 'domain' => 'midcom.helper.datamanager2', |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | return $value; |
| 228 | 228 | }; |
| 229 | 229 | |
| 230 | - $normalize_validation = function (Options $options, $value) { |
|
| 230 | + $normalize_validation = function(Options $options, $value) { |
|
| 231 | 231 | $validation = []; |
| 232 | 232 | |
| 233 | 233 | foreach ((array) $value as $key => $rule) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | $rule = ['type' => $rule]; |
| 240 | 240 | } elseif (!array_key_exists('type', $rule)) { |
| 241 | 241 | throw new midcom_error("Missing validation rule type for rule {$key} on field {$options['name']}, this is a required option."); |
| 242 | - } elseif ( $rule['type'] == 'compare' |
|
| 242 | + } elseif ($rule['type'] == 'compare' |
|
| 243 | 243 | && !array_key_exists('compare_with', $rule)) { |
| 244 | 244 | throw new midcom_error("Missing compare_with option for compare type rule {$key} on field {$options['name']}, this is a required option."); |
| 245 | 245 | } |