@@ -65,8 +65,8 @@ |
||
65 | 65 | private function prepare_field(array $config) |
66 | 66 | { |
67 | 67 | if ( empty($config['storage']['location']) |
68 | - // This line is needed because a parameter default is set by the schema parser and then ignored |
|
69 | - // by the type. The things we do for backwards compatibility... |
|
68 | + // This line is needed because a parameter default is set by the schema parser and then ignored |
|
69 | + // by the type. The things we do for backwards compatibility... |
|
70 | 70 | || $config['storage']['location'] === 'parameter') { |
71 | 71 | if (class_exists('midcom\datamanager\storage\\' . $config['type'])) { |
72 | 72 | $classname = 'midcom\datamanager\storage\\' . $config['type']; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | $config['name'] = $name; |
34 | 34 | $field = $this->prepare_field($config); |
35 | - if ( isset($config['default']) |
|
35 | + if (isset($config['default']) |
|
36 | 36 | && !$this->object->id) { |
37 | 37 | $field->set_value($config['default']); |
38 | 38 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | private function prepare_field(array $config) |
66 | 66 | { |
67 | - if ( empty($config['storage']['location']) |
|
67 | + if (empty($config['storage']['location']) |
|
68 | 68 | // This line is needed because a parameter default is set by the schema parser and then ignored |
69 | 69 | // by the type. The things we do for backwards compatibility... |
70 | 70 | || $config['storage']['location'] === 'parameter') { |
@@ -25,7 +25,7 @@ |
||
25 | 25 | { |
26 | 26 | //workaround for weird mgd API behavior where setting falsy (i.e. deleting) a nonexistent parameter |
27 | 27 | //returns an error |
28 | - if ( !$this->value |
|
28 | + if (!$this->value |
|
29 | 29 | && $this->load() === null) { |
30 | 30 | return true; |
31 | 31 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | $string = ''; |
26 | 26 | foreach ($view as $child) { |
27 | - if ( array_key_exists('start_fieldset', $child->vars) |
|
27 | + if (array_key_exists('start_fieldset', $child->vars) |
|
28 | 28 | && $child->vars['start_fieldset'] !== null) { |
29 | 29 | $string .= '<div class="fieldset">'; |
30 | 30 | if (!empty($child->vars['start_fieldset']['title'])) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | } |
34 | 34 | $string .= $this->renderer->row($child); |
35 | - if ( array_key_exists('end_fieldset', $child->vars) |
|
35 | + if (array_key_exists('end_fieldset', $child->vars) |
|
36 | 36 | && $child->vars['end_fieldset'] !== null) { |
37 | 37 | $end_fieldsets = max(1, (int) $child->vars['end_fieldset']); |
38 | 38 | for ($i = 0; $i < $end_fieldsets; $i++) { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | public function form_widget_simple(FormView $view, array $data) |
86 | 86 | { |
87 | - if ( !empty($data['value']) |
|
87 | + if (!empty($data['value']) |
|
88 | 88 | || is_numeric($data['value'])) { |
89 | 89 | return $this->escape($data['value']); |
90 | 90 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $string = $this->renderer->widget($view['date']); |
132 | 132 | |
133 | 133 | if (isset($view['time'])) { |
134 | - $string .= ' '. $this->renderer->widget($view['time']); |
|
134 | + $string .= ' ' . $this->renderer->widget($view['time']); |
|
135 | 135 | } |
136 | 136 | return $string; |
137 | 137 | } |
@@ -98,7 +98,7 @@ |
||
98 | 98 | |
99 | 99 | public function reverseTransform($array) |
100 | 100 | { |
101 | - if (!is_array($array) ) { |
|
101 | + if (!is_array($array)) { |
|
102 | 102 | throw new TransformationFailedException('Expected an array.'); |
103 | 103 | } |
104 | 104 |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | - if ( $input === null |
|
37 | - || ( $input instanceof DateTime |
|
36 | + if ($input === null |
|
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 | } |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | |
56 | 56 | public function reverseTransform($array) |
57 | 57 | { |
58 | - if (!is_array($array) ) { |
|
58 | + if (!is_array($array)) { |
|
59 | 59 | throw new TransformationFailedException('Expected an array.'); |
60 | 60 | } |
61 | 61 | |
62 | 62 | if (empty($array['date']) |
63 | - || ( $array['date'] instanceof DateTime |
|
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 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | public function transform($input) |
24 | 24 | { |
25 | - if ( $this->config['dm2_type'] == 'select' |
|
25 | + if ($this->config['dm2_type'] == 'select' |
|
26 | 26 | && $this->config['type_config']['allow_multiple']) { |
27 | 27 | switch ($this->config['type_config']['multiple_storagemode']) { |
28 | 28 | case 'serialized': |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function reverseTransform($array) |
44 | 44 | { |
45 | - if (!is_array($array) ) { |
|
45 | + if (!is_array($array)) { |
|
46 | 46 | throw new TransformationFailedException('Expected an array.'); |
47 | 47 | } |
48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | return reset($array['selection']); |
55 | 55 | } |
56 | 56 | |
57 | - if ( $this->config['dm2_type'] == 'select' |
|
57 | + if ($this->config['dm2_type'] == 'select' |
|
58 | 58 | && $this->config['type_config']['allow_multiple']) { |
59 | 59 | switch ($this->config['type_config']['multiple_storagemode']) { |
60 | 60 | case 'serialized': |
@@ -56,7 +56,7 @@ |
||
56 | 56 | |
57 | 57 | if ($this->form->isSubmitted()) { |
58 | 58 | $button = $this->form->getClickedButton(); |
59 | - if ( $button |
|
59 | + if ($button |
|
60 | 60 | && $button->getConfig()->getOption('operation') == self::CANCEL) { |
61 | 61 | return self::CANCEL; |
62 | 62 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | public function validate($value, Constraint $constraint) |
14 | 14 | { |
15 | - if ( empty($value['archival']) |
|
15 | + if (empty($value['archival']) |
|
16 | 16 | && empty($value['file'])) { |
17 | 17 | $this->context->buildViolation($constraint->message) |
18 | 18 | ->addViolation(); |
@@ -58,7 +58,8 @@ |
||
58 | 58 | |
59 | 59 | try { |
60 | 60 | return midcom::get()->dbfactory->get_object_by_guid($identifier); |
61 | - } catch (midcom_error $e) { |
|
61 | + } |
|
62 | + catch (midcom_error $e) { |
|
62 | 63 | $e->log(); |
63 | 64 | return false; |
64 | 65 | } |