@@ -22,7 +22,7 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function configureOptions(OptionsResolver $resolver) : void |
| 24 | 24 | { |
| 25 | - $map_attr = function (Options $options, $value) { |
|
| 25 | + $map_attr = function(Options $options, $value) { |
|
| 26 | 26 | $value ??= []; |
| 27 | 27 | $value['rows'] = $options['widget_config']['height']; |
| 28 | 28 | $value['cols'] = $options['widget_config']['width']; |
@@ -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 null; |
| 66 | 66 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | return []; |
| 55 | 55 | } |
| 56 | 56 | $results = explode($this->multiple_separator, substr($input, 1, -1)); |
| 57 | - if ( !empty($this->config['widget_config']['id_field']) |
|
| 57 | + if (!empty($this->config['widget_config']['id_field']) |
|
| 58 | 58 | && $this->config['widget_config']['id_field'] == 'id') { |
| 59 | 59 | $results = array_map('intval', $results); |
| 60 | 60 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | public function reverseTransform(mixed $array) : mixed |
| 69 | 69 | { |
| 70 | - if (!is_array($array) ) { |
|
| 70 | + if (!is_array($array)) { |
|
| 71 | 71 | throw new TransformationFailedException('Expected an array.'); |
| 72 | 72 | } |
| 73 | 73 | |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function setTargetUrl(string $url) : static |
| 29 | 29 | { |
| 30 | - if ( !str_starts_with($url, "/") |
|
| 30 | + if (!str_starts_with($url, "/") |
|
| 31 | 31 | && !preg_match('|^https?://|', $url)) { |
| 32 | 32 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) ?: '/'; |
| 33 | 33 | $url = $prefix . $url; |