@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function configureOptions(OptionsResolver $resolver) |
26 | 26 | { |
27 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
27 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
28 | 28 | $widget_defaults = array( |
29 | 29 | 'map_action_elements' => false, |
30 | 30 | 'show_title' => true, |
@@ -33,17 +33,17 @@ |
||
33 | 33 | public function configureOptions(OptionsResolver $resolver) |
34 | 34 | { |
35 | 35 | parent::configureOptions($resolver); |
36 | - $map_options = function (Options $options) { |
|
36 | + $map_options = function(Options $options) { |
|
37 | 37 | $return_options = array(); |
38 | 38 | if (isset($options['type_config']['options'])) { |
39 | 39 | foreach ($options['type_config']['options'] as $key => $value) { |
40 | 40 | //symfony expects only strings |
41 | - $return_options[$value] = (string)$key; |
|
41 | + $return_options[$value] = (string) $key; |
|
42 | 42 | } |
43 | 43 | return $return_options; |
44 | 44 | } |
45 | 45 | }; |
46 | - $map_multiple = function (Options $options) { |
|
46 | + $map_multiple = function(Options $options) { |
|
47 | 47 | return !empty($options['type_config']['allow_multiple']); |
48 | 48 | }; |
49 | 49 |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | $resolver->setDefaults(array( |
40 | 40 | 'error_bubbling' => false |
41 | 41 | )); |
42 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
42 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
43 | 43 | $widget_defaults = array( |
44 | 44 | 'map_action_elements' => false, |
45 | 45 | 'show_title' => false |
46 | 46 | ); |
47 | 47 | return helper::resolve_options($widget_defaults, $value); |
48 | 48 | }); |
49 | - $resolver->setNormalizer('constraints', function (Options $options, $value) { |
|
49 | + $resolver->setNormalizer('constraints', function(Options $options, $value) { |
|
50 | 50 | if ($options['required']) { |
51 | 51 | return array(new constraint()); |
52 | 52 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | $builder->add('delete', compat::get_type_name('checkbox'), array('attr' => array( |
68 | 68 | "class" => "midcom_datamanager_photo_checkbox" |
69 | - ), "required" => false )); |
|
69 | + ), "required" => false)); |
|
70 | 70 | $builder->add('identifier', compat::get_type_name('hidden'), array('data' => 'file')); |
71 | 71 | |
72 | 72 | $head = midcom::get()->head; |
@@ -47,17 +47,17 @@ discard block |
||
47 | 47 | 'delete_empty' => true, |
48 | 48 | 'error_bubbling' => false |
49 | 49 | )); |
50 | - $resolver->setNormalizer('type', function (Options $options, $value) { |
|
50 | + $resolver->setNormalizer('type', function(Options $options, $value) { |
|
51 | 51 | return $options['dm2_type']; |
52 | 52 | }); |
53 | - $resolver->setNormalizer('type_config', function (Options $options, $value) { |
|
53 | + $resolver->setNormalizer('type_config', function(Options $options, $value) { |
|
54 | 54 | $widget_defaults = array( |
55 | 55 | 'sortable' => false, |
56 | 56 | 'max_count' => 0 |
57 | 57 | ); |
58 | 58 | return helper::resolve_options($widget_defaults, $value); |
59 | 59 | }); |
60 | - $resolver->setNormalizer('constraints', function (Options $options, $value) { |
|
60 | + $resolver->setNormalizer('constraints', function(Options $options, $value) { |
|
61 | 61 | $validation = array(); |
62 | 62 | if ($options['type_config']['max_count'] > 0) { |
63 | 63 | $validation['max'] = $options['type_config']['max_count']; |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | } |
71 | 71 | return $validation; |
72 | 72 | }); |
73 | - $resolver->setNormalizer('options', function (Options $options, $value) { |
|
73 | + $resolver->setNormalizer('options', function(Options $options, $value) { |
|
74 | 74 | return array( |
75 | 75 | 'required' => false, //@todo no idea why this is necessary |
76 | 76 | 'widget_config' => $options['widget_config'] |
77 | 77 | ); |
78 | 78 | }); |
79 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
79 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
80 | 80 | if (!array_key_exists('sortable', $value)) { |
81 | 81 | $value['sortable'] = false; |
82 | 82 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $this->content .= "{$this->abstract}\n"; |
138 | 138 | } |
139 | 139 | |
140 | - if (! $this->title) { |
|
140 | + if (!$this->title) { |
|
141 | 141 | $this->title = $this->document_url; |
142 | 142 | } |
143 | 143 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | if (!empty($field->vars['value'])) { |
179 | 179 | //only index the first attachment for now |
180 | 180 | $attachment = array_shift($field->vars['value']); |
181 | - if ( !$attachment instanceof \midcom_db_attachment |
|
181 | + if (!$attachment instanceof \midcom_db_attachment |
|
182 | 182 | && !empty($attachment['object'])) { |
183 | 183 | //This is the form edit case |
184 | 184 | //@todo: In create case, nothing is found currently |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | private function resolve_auto_method($name) |
264 | 264 | { |
265 | - if ( $name == 'abstract' |
|
265 | + if ($name == 'abstract' |
|
266 | 266 | || $name == 'title' |
267 | 267 | || $name == 'author') { |
268 | 268 | return $name; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | $qb = org_openpsa_directmarketing_campaign_messagereceipt_dba::new_query_builder(); |
86 | 86 | $qb->add_constraint('token', '=', $token); |
87 | 87 | $qb->add_constraint('orgOpenpsaObtype', '=', $type); |
88 | - $ret = $qb->execute(); |
|
88 | + $ret = $qb->execute(); |
|
89 | 89 | debug_print_r("_qb_token_receipts({$token}) returned", $ret); |
90 | 90 | if (empty($ret)) { |
91 | 91 | midcom::get()->auth->drop_sudo(); |
@@ -34,7 +34,8 @@ discard block |
||
34 | 34 | // Add person to campaign |
35 | 35 | try { |
36 | 36 | $campaign = new org_openpsa_directmarketing_campaign_dba($_POST['add_to_campaign']); |
37 | - } catch (midcom_error $e) { |
|
37 | + } |
|
38 | + catch (midcom_error $e) { |
|
38 | 39 | // FIXME: More informative error message |
39 | 40 | $this->notify('Failed adding person %s to campaign %s', $_POST['add_to_campaign'], 'error'); |
40 | 41 | return; |
@@ -87,7 +88,8 @@ discard block |
||
87 | 88 | try { |
88 | 89 | $campaigns[$membership->campaign] = new org_openpsa_directmarketing_campaign_dba($membership->campaign); |
89 | 90 | $campaign_membership_map[$membership->campaign] = $membership; |
90 | - } catch (midcom_error $e) { |
|
91 | + } |
|
92 | + catch (midcom_error $e) { |
|
91 | 93 | debug_add('Failed to load campaign ' . $membership->campaign . ', reason: ' . $e->getMessage()); |
92 | 94 | } |
93 | 95 | } |
@@ -61,7 +61,8 @@ discard block |
||
61 | 61 | //check if related at_entry exists |
62 | 62 | try { |
63 | 63 | $notification_entry = new midcom_services_at_entry_dba($entry); |
64 | - } catch (midcom_error $e) { |
|
64 | + } |
|
65 | + catch (midcom_error $e) { |
|
65 | 66 | //relatedto links to a non-existing at_entry - so create a new one an link to it |
66 | 67 | $notification_entry = new midcom_services_at_entry_dba(); |
67 | 68 | $notification_entry->create(); |
@@ -83,7 +84,8 @@ discard block |
||
83 | 84 | $notification_entry = new midcom_services_at_entry_dba($mc_entry->get_subkey($key, 'fromGuid')); |
84 | 85 | //check if related at_entry exists & delete it |
85 | 86 | $notification_entry->delete(); |
86 | - } catch (midcom_error $e) { |
|
87 | + } |
|
88 | + catch (midcom_error $e) { |
|
87 | 89 | $e->log(); |
88 | 90 | } |
89 | 91 | } |
@@ -52,7 +52,8 @@ discard block |
||
52 | 52 | try { |
53 | 53 | $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($task->agreement); |
54 | 54 | $item->deliverable = $deliverable->id; |
55 | - } catch (midcom_error $e) { |
|
55 | + } |
|
56 | + catch (midcom_error $e) { |
|
56 | 57 | $e->log(); |
57 | 58 | } |
58 | 59 | $item->invoice = $invoice->id; |
@@ -144,7 +145,8 @@ discard block |
||
144 | 145 | $customer = org_openpsa_contacts_group_dba::get_cached($customer_id); |
145 | 146 | $data['customer_label'] = $customer->official; |
146 | 147 | $data['disabled'] = ''; |
147 | - } catch (midcom_error $e) { |
|
148 | + } |
|
149 | + catch (midcom_error $e) { |
|
148 | 150 | $data['customer_label'] = $this->_l10n->get('no customer'); |
149 | 151 | $data['disabled'] = ' disabled="disabled"'; |
150 | 152 | } |
@@ -167,7 +169,8 @@ discard block |
||
167 | 169 | } else { |
168 | 170 | $data['invoiceable_units'] = $task->plannedHours; |
169 | 171 | } |
170 | - } catch (midcom_error $e) { |
|
172 | + } |
|
173 | + catch (midcom_error $e) { |
|
171 | 174 | $e->log(); |
172 | 175 | if ($this->_config->get('default_hourly_price')) { |
173 | 176 | $data['default_price'] = $this->_config->get('default_hourly_price'); |