Completed
Pull Request — master (#198)
by
unknown
19:02
created
lib/midcom/helper/nav/backend.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         if (!array_key_exists($id, self::$_nodes)) {
271 271
             $node = new midcom_helper_nav_node($this, $topic);
272 272
 
273
-            if (    !$node->is_object_visible()
273
+            if (!$node->is_object_visible()
274 274
                 || !$node->is_readable_by($this->_user_id)) {
275 275
                 return MIDCOM_ERRFORBIDDEN;
276 276
             }
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
             });
307 307
             foreach ($leaves as $id => $leaf) {
308 308
                 $this->_leaves[$id] = $leaf;
309
-                $this->_loaded_leaves[$node->id][$id] =& $this->_leaves[$id];
309
+                $this->_loaded_leaves[$node->id][$id] = & $this->_leaves[$id];
310 310
             }
311 311
         }
312 312
     }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
                 continue;
387 387
             }
388 388
 
389
-            if (   !$show_noentry
389
+            if (!$show_noentry
390 390
                 && self::$_nodes[$id]->noentry) {
391 391
                 // Hide "noentry" items
392 392
                 continue;
Please login to merge, or discard this patch.
lib/org/openpsa/sales/handler/offer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
         $this->load_pdf_builder();
109 109
 
110 110
         $schemadb = schemadb::from_path($this->_config->get('schemadb_pdf'));
111
-        $field =& $schemadb->get_first()->get_field('deliverables');
111
+        $field = & $schemadb->get_first()->get_field('deliverables');
112 112
         $field['type_config']['constraints'][] = [
113 113
             'field' => 'salesproject',
114 114
             'op' => '=',
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/handler/scheduled.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,8 @@  discard block
 block discarded – undo
61 61
         try {
62 62
             $deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($at_entry->arguments['deliverable']);
63 63
             $salesproject = org_openpsa_sales_salesproject_dba::get_cached($deliverable->salesproject);
64
-        } catch (midcom_error $e) {
64
+        }
65
+        catch (midcom_error $e) {
65 66
             $e->log();
66 67
             return $invoice;
67 68
         }
@@ -103,7 +104,8 @@  discard block
 block discarded – undo
103 104
                     $invoice[$fieldname] = '<a href="' . $sales_url . 'list/customer/' . $object->guid . '/">' . $invoice[$fieldname] . '</a>';
104 105
                 }
105 106
                 $invoice['index_' . $fieldname] = $object->get_label();
106
-            } catch (midcom_error $e) {
107
+            }
108
+            catch (midcom_error $e) {
107 109
                 $e->log();
108 110
             }
109 111
         }
Please login to merge, or discard this patch.
lib/midcom/helper/reflector/main.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -229,7 +229,8 @@  discard block
 block discarded – undo
229 229
         if ($object instanceof mgdobject) {
230 230
             try {
231 231
                 $obj = midcom::get()->dbfactory->convert_midgard_to_midcom($object);
232
-            } catch (midcom_error $e) {
232
+            }
233
+            catch (midcom_error $e) {
233 234
                 return false;
234 235
             }
235 236
         } else {
@@ -658,7 +659,8 @@  discard block
 block discarded – undo
658 659
         if (!isset(self::$_cache['name'][$key])) {
659 660
             try {
660 661
                 self::$_cache['name'][$key] = self::get($object)->get_name_property_nonstatic($object);
661
-            } catch (midcom_error $e) {
662
+            }
663
+            catch (midcom_error $e) {
662 664
                 debug_add('Could not get reflector instance for class ' . $key . ': ' . $e->getMessage(), MIDCOM_LOG_ERROR);
663 665
                 self::$_cache['name'][$key] = null;
664 666
             }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 
406 406
         $label_prop = $this->get_label_property();
407 407
 
408
-        if (    is_string($label_prop)
408
+        if (is_string($label_prop)
409 409
              && $label_prop != 'guid'
410 410
              && $this->_mgd_reflector->property_exists($label_prop)) {
411 411
             $search_properties[$label_prop] = true;
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
                 continue;
467 467
             }
468 468
 
469
-            if (   !$ref->is_link($property)
469
+            if (!$ref->is_link($property)
470 470
                 && $ref->get_midgard_type($property) != MGD_TYPE_GUID) {
471 471
                 continue;
472 472
             }
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
                 return $schema_type;
531 531
             }
532 532
         }
533
-        if (   isset($extends[$schema_type])
533
+        if (isset($extends[$schema_type])
534 534
             && class_exists($extends[$schema_type])) {
535 535
             return $extends[$schema_type];
536 536
         }
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
         // Check for decorators first
584 584
         if (!empty($class_instance->__mgdschema_class_name__)) {
585 585
             $parent_class = $class_instance->__mgdschema_class_name__;
586
-            if (   !empty($class_instance->__object)
586
+            if (!empty($class_instance->__object)
587 587
                 && !$class_instance->__object instanceof $class_instance->__mgdschema_class_name__) {
588 588
                 $parent_class = get_class($class_instance->__object);
589 589
                 debug_add('mgdschema object class ' . $parent_class . ' is not an instance of ' . $class_instance->__mgdschema_class_name__, MIDCOM_LOG_INFO);
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
         $name_exceptions = $this->_config->get('name_exceptions');
619 619
         foreach ($name_exceptions as $class => $property) {
620 620
             if (midcom::get()->dbfactory->is_a($object, $class)) {
621
-                if (   $property !== false
621
+                if ($property !== false
622 622
                     && !$this->_mgd_reflector->property_exists($property)) {
623 623
                     debug_add("Matched class '{$key}' to '{$class}' via is_a but property '{$property}' does not exist", MIDCOM_LOG_ERROR);
624 624
                     self::$_cache['name'][$key] = false;
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
         if ($title_property === null) {
675 675
             $title_property = self::get_title_property($object);
676 676
         }
677
-        if (   empty($title_property)
677
+        if (empty($title_property)
678 678
             || !self::get($object)->property_exists($title_property)) {
679 679
             // Could not resolve valid property
680 680
             return false;
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
 
722 722
         foreach ($title_exceptions as $class => $property) {
723 723
             if (midcom::get()->dbfactory->is_a($object, $class)) {
724
-                if (   $property !== false
724
+                if ($property !== false
725 725
                     && !$this->_mgd_reflector->property_exists($property)) {
726 726
                     debug_add("Matched class '{$key}' to '{$class}' via is_a but property '{$property}' does not exist", MIDCOM_LOG_ERROR);
727 727
                     self::$_cache['title'][$key] = false;
Please login to merge, or discard this patch.
src/midcom/grid/grid.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         if (file_exists(MIDCOM_STATIC_ROOT . $jqgrid_path . 'i18n/grid.locale-' . $language . '.js')) {
110 110
             $lang = $language;
111 111
         }
112
-        $head->add_jsfile(MIDCOM_STATIC_URL . $jqgrid_path . 'i18n/grid.locale-'. $lang . '.js');
112
+        $head->add_jsfile(MIDCOM_STATIC_URL . $jqgrid_path . 'i18n/grid.locale-' . $lang . '.js');
113 113
         $head->add_jsfile(MIDCOM_STATIC_URL . $jqgrid_path . 'jquery.jqgrid.min.js');
114 114
 
115 115
         \org_openpsa_widgets_ui::add_head_elements();
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     public function set_option($key, $value, $autoquote_string = true)
166 166
     {
167 167
         $this->_raw_options[$key] = $value;
168
-        if (   $autoquote_string
168
+        if ($autoquote_string
169 169
             && is_string($value)) {
170 170
             $value = '"' . str_replace('"', '\\"', $value) . '"';
171 171
         } elseif ($value === true) {
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     public function set_select_column($name, $label, $options, array $selectdata)
199 199
     {
200 200
         $selectstring = implode(';', array_map(
201
-            function ($key, $value) {
201
+            function($key, $value) {
202 202
                 return $key . ':' . $value;
203 203
             },
204 204
             array_keys($selectdata),
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
      */
250 250
     public function remove_column($name)
251 251
     {
252
-        if (   empty($name)
252
+        if (empty($name)
253 253
             || !array_key_exists($name, $this->_columns)) {
254 254
             throw new midcom_error('Invalid column name ' . $name);
255 255
         }
Please login to merge, or discard this patch.
src/midcom/grid/provider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
     private function _convert_to_localdata()
234 234
     {
235
-        return "var " . $this->_grid->get_identifier() . '_entries = ' .  json_encode($this->get_rows()) . ";\n";
235
+        return "var " . $this->_grid->get_identifier() . '_entries = ' . json_encode($this->get_rows()) . ";\n";
236 236
     }
237 237
 
238 238
     private function _render_json()
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
             $this->_sort_field = $query['sidx'];
267 267
             $this->_sort_direction = strtoupper($query['sord']);
268 268
         }
269
-        if (   !empty($query['_search'])
269
+        if (!empty($query['_search'])
270 270
             && $query['_search'] === 'true') {
271 271
             foreach ($query as $field => $value) {
272 272
                 if (in_array($field, ['_search', 'nd', 'page', 'rows', 'sidx', 'sord'])) {
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
         $this->_total_rows = $qb->count();
293 293
 
294
-        if (   $this->_datatype == 'json'
294
+        if ($this->_datatype == 'json'
295 295
             && !empty($this->_results_per_page)) {
296 296
             $qb->set_limit($this->_results_per_page);
297 297
             if (!empty($this->_offset)) {
Please login to merge, or discard this patch.
lib/org/openpsa/invoices/handler/invoice/items.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,8 @@  discard block
 block discarded – undo
48 48
                 if ($sales_url) {
49 49
                     $entry['deliverable'] = '<a href="' . $sales_url . 'deliverable/' . $deliverable->guid . '/">' . $entry['deliverable'] . '</a>';
50 50
                 }
51
-            } catch (midcom_error $e) {
51
+            }
52
+            catch (midcom_error $e) {
52 53
                 $entry['deliverable'] = '';
53 54
             }
54 55
             try {
@@ -57,7 +58,8 @@  discard block
 block discarded – undo
57 58
                 if ($projects_url) {
58 59
                     $entry['task'] = '<a href="' . $projects_url . 'task/' . $task->guid . '/">' . $entry['task'] . '</a>';
59 60
                 }
60
-            } catch (midcom_error $e) {
61
+            }
62
+            catch (midcom_error $e) {
61 63
                 $entry['task'] = '';
62 64
             }
63 65
 
Please login to merge, or discard this patch.
lib/org/openpsa/calendar/conflictmanager.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -195,7 +195,8 @@  discard block
 block discarded – undo
195 195
             try {
196 196
                 $event = new org_openpsa_calendar_event_dba($member->event);
197 197
                 $set_as_modified = true;
198
-            } catch (midcom_error $e) {
198
+            }
199
+            catch (midcom_error $e) {
199 200
                 debug_add("event_resource #{$member->id} links to bogus event #{$member->event}, skipping and removing", MIDCOM_LOG_WARN);
200 201
                 $member->delete();
201 202
                 return;
@@ -223,7 +224,8 @@  discard block
 block discarded – undo
223 224
 
224 225
         try {
225 226
             $event = new org_openpsa_calendar_event_dba($member->eid);
226
-        } catch (midcom_error $e) {
227
+        }
228
+        catch (midcom_error $e) {
227 229
             debug_add("eventmember #{$member->id} links to bogus event #{$member->eid}, skipping and removing", MIDCOM_LOG_WARN);
228 230
             $member->delete();
229 231
             return;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         }
126 126
         // TODO: Shared tasks need a separate check (different member object)
127 127
 
128
-        if (   !empty($this->busy_members)
128
+        if (!empty($this->busy_members)
129 129
             || !empty($this->busy_resources)) {
130 130
             //Unresolved conflicts (note return value is for conflicts not lack of them)
131 131
             midcom::get()->auth->drop_sudo();
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         }
189 189
 
190 190
         if (array_key_exists($member->event, $modified_events)) {
191
-            $event =& $modified_events[$member->event];
191
+            $event = & $modified_events[$member->event];
192 192
             $set_as_modified = false;
193 193
         } else {
194 194
             try {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         }
203 203
         debug_add("overlap found in event {$event->title} (#{$event->id})");
204 204
 
205
-        if (   $event->tentative
205
+        if ($event->tentative
206 206
             && $rob_tentative) {
207 207
             debug_add('event is tentative, robbing resources');
208 208
             $event->resources = array_diff_key($event->resources, $this->_event->resources);
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         }
230 230
         debug_add("overlap found in event {$event->title} (#{$event->id})");
231 231
 
232
-        if (   $event->tentative
232
+        if ($event->tentative
233 233
             && $rob_tentative) {
234 234
             debug_add('event is tentative, robbing participants');
235 235
             $event->participants = array_diff_key($event->participants, $this->_event->participants);
Please login to merge, or discard this patch.
src/midcom/datamanager/extension/type/captchaType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@
 block discarded – undo
35 35
     public function buildForm(FormBuilderInterface $builder, array $options)
36 36
     {
37 37
         $session_key = md5($builder->getForm()->getName() . '_session_key');
38
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($session_key) {
38
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($session_key) {
39 39
             $value = $event->getForm()->getData();
40 40
             $session = new midcom_services_session('midcom_datamanager_captcha');
41 41
             $l10n = midcom::get()->i18n->get_l10n('midcom.datamanager');
42 42
 
43
-            if (   !$session->exists($session_key)
43
+            if (!$session->exists($session_key)
44 44
                 || $value != $session->get($session_key)) {
45 45
                 $event->getForm()->addError(new FormError($l10n->get('captcha validation failed')));
46 46
             }
Please login to merge, or discard this patch.