Passed
Branchdevelop81 (6bbe30)
by Robin
08:10
created
programs/Set/AppCustomField.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,6 @@
 block discarded – undo
42 42
 /**
43 43
  * @method FuncApp              App()
44 44
  * @method AppCustomFieldSet    getParentSet()
45
-
46 45
  * @property string $name
47 46
  * @property string $fieldname
48 47
  * @property string $description
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
                 break;
84 84
 
85 85
             default:
86
-                $function = 'Capwelton\LibOrm\ORM_' . $this->fieldtype . 'Field';
86
+                $function = 'Capwelton\LibOrm\ORM_'.$this->fieldtype.'Field';
87 87
                 $field = $function($this->fieldname);
88 88
                 break;
89 89
         }
Please login to merge, or discard this patch.
programs/Set/AppCustomFieldSet.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,6 @@
 block discarded – undo
52 52
  * @method AppCustomField request(mixed $criteria)
53 53
  * @method AppCustomField[]|ORMIterator select(ORMCriteria $criteria)
54 54
  * @method AppCustomField newRecord()
55
-
56 55
  * @property ORMStringField $name
57 56
  * @property ORMStringField $fieldname
58 57
  * @property ORMTextField $description
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
             throw new AppSaveException($this->App()->translate('The name is mandatory'));
130 130
         }
131 131
 
132
-        return '_' . $name;
132
+        return '_'.$name;
133 133
     }
134 134
 
135 135
     /**
Please login to merge, or discard this patch.
programs/Set/AppRecord.php 2 patches
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $value = $this->oParentSet->getBackend()->getRecordValue($this, $sFieldName);
70 70
         $field = $this->oParentSet->$sFieldName;
71
-        if(! is_null($value) && $field instanceof ORMFkField){
71
+        if (!is_null($value) && $field instanceof ORMFkField) {
72 72
             
73 73
             $sClassName = $field->getForeignSetName();
74
-            if($field instanceof AppFkField){
74
+            if ($field instanceof AppFkField) {
75 75
                 $App = $field->App();
76
-            }else{
76
+            } else {
77 77
                 $App = $this->App();
78 78
             }
79 79
             $set = $App->$sClassName();
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function App()
108 108
     {
109
-        if(! isset($this->app)){
109
+        if (!isset($this->app)) {
110 110
             // If the app object was not specified (through the setApp() method),
111 111
             // we set it as parent set's App.
112 112
             $this->setApp($this->getParentSet()
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
128 128
         $rClass = new \ReflectionClass(get_class($this));
129 129
         $component = $App->getComponentByName($rClass->getShortName());
130 130
         $classname = $rClass->getShortName();
131
-        if(isset($component)){
131
+        if (isset($component)) {
132 132
             return $component->getRecordClassName();
133 133
             // list(, $classname) = explode('_', $component->getRecordClassName());
134 134
             // return $classname;
135 135
         }
136
-        if(str_contains($classname,'_')){
136
+        if (str_contains($classname, '_')) {
137 137
             list (, $classname) = explode('_', get_class($this));
138 138
         }
139 139
         return $classname;
@@ -146,18 +146,18 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public function getRef()
148 148
     {
149
-        if(! isset($this->id)){
149
+        if (!isset($this->id)) {
150 150
             throw new AppException('Trying to get the reference string of a record without an id.');
151 151
         }
152 152
         $classname = $this->getClassName();
153
-        return $classname . ':' . $this->id;
153
+        return $classname.':'.$this->id;
154 154
     }
155 155
 
156 156
     public function getFrontRef()
157 157
     {
158
-        if($this->getParentSet()->usesWebIdTrait() && isset($this->webId)){
158
+        if ($this->getParentSet()->usesWebIdTrait() && isset($this->webId)) {
159 159
             $classname = $this->getClassName();
160
-            return $classname . ':' . $this->webId;
160
+            return $classname.':'.$this->webId;
161 161
         }
162 162
         return $this->getRef();
163 163
     }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     {
187 187
         $App = $this->App();
188 188
         
189
-        if(! isset($deletedStatus)){
189
+        if (!isset($deletedStatus)) {
190 190
             $deletedStatus = AppTraceableRecord::DELETED_STATUS_DELETED;
191 191
         }
192 192
         
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         // referenced elements.
199 199
         $manyRelations = $set->getHasManyRelations();
200 200
         
201
-        foreach ($manyRelations as $manyRelation){
201
+        foreach ($manyRelations as $manyRelation) {
202 202
             /* @var $manyRelation ORMManyRelation */
203 203
             
204 204
             $foreignSetClassName = $manyRelation->getForeignSetClassName();
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                     
213 213
                     $foreignRecords = $foreignSet->select($foreignSet->$foreignSetFieldName->is($recordId));
214 214
                     
215
-                    foreach ($foreignRecords as $foreignRecord){
215
+                    foreach ($foreignRecords as $foreignRecord) {
216 216
                         $foreignRecord->$foreignSetFieldName = 0;
217 217
                         $foreignRecord->save();
218 218
                     }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                     
224 224
                     $foreignRecords = $foreignSet->select($foreignSet->$foreignSetFieldName->is($recordId));
225 225
                     
226
-                    foreach ($foreignRecords as $foreignRecord){
226
+                    foreach ($foreignRecords as $foreignRecord) {
227 227
                         $foreignRecord->delete();
228 228
                     }
229 229
                     
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         // referenced elements.
270 270
         $manyRelations = $set->getHasManyRelations();
271 271
         
272
-        foreach ($manyRelations as $manyRelation){
272
+        foreach ($manyRelations as $manyRelation) {
273 273
             /* @var $manyRelation ORMManyRelation */
274 274
             
275 275
             $foreignSetClassName = $manyRelation->getForeignSetClassName();
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             // $foreignSet = new $foreignSetClassName($App);
280 280
             $foreignRecords = $foreignSet->select($foreignSet->$foreignSetFieldName->is($recordId));
281 281
             
282
-            foreach ($foreignRecords as $foreignRecord){
282
+            foreach ($foreignRecords as $foreignRecord) {
283 283
                 $foreignRecord->$foreignSetFieldName = $id;
284 284
                 $foreignRecord->save();
285 285
             }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         $links = $linkSet->select($linkSet->sourceClass->is($recordClassName)
293 293
             ->_AND_($linkSet->sourceId->is($recordId)));
294 294
         
295
-        foreach ($links as $link){
295
+        foreach ($links as $link) {
296 296
             $link->sourceId = $id;
297 297
             $link->save();
298 298
         }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
         $links = $linkSet->select($linkSet->targetClass->is($recordClassName)
301 301
             ->_AND_($linkSet->targetId->is($recordId)));
302 302
         
303
-        foreach ($links as $link){
303
+        foreach ($links as $link) {
304 304
             $link->targetId = $id;
305 305
             $link->save();
306 306
         }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
         
326 326
         $relatedRecords = array();
327 327
         
328
-        foreach ($manyRelations as $manyRelation){
328
+        foreach ($manyRelations as $manyRelation) {
329 329
             /* @var $manyRelation ORMManyRelation */
330 330
             
331 331
             $foreignSetClassName = $manyRelation->getForeignSetClassName();
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
             // $foreignSet = new $foreignSetClassName($App);
337 337
             $foreignRecords = $foreignSet->select($foreignSet->$foreignSetFieldName->is($recordId));
338 338
             
339
-            if($foreignRecords->count() > 0){
339
+            if ($foreignRecords->count() > 0) {
340 340
                 $relatedRecords[$foreignSetClassName] = $foreignRecords;
341 341
             }
342 342
         }
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     {
354 354
         $path = $this->App()->uploadPath();
355 355
         
356
-        if(null === $path){
356
+        if (null === $path) {
357 357
             throw new \Exception('Missing upload path information');
358 358
             return null;
359 359
         }
@@ -373,12 +373,12 @@  discard block
 block discarded – undo
373 373
         $linkSet = $App->LinkSet();
374 374
         
375 375
         $sourceClass = $source->getClassName();
376
-        if(strpos($sourceClass, '\\')){
376
+        if (strpos($sourceClass, '\\')) {
377 377
             $targetClass = (new \ReflectionClass($sourceClass))->getShortName();
378 378
         }
379 379
         
380 380
         $targetClass = $this->getClassName();
381
-        if(strpos($targetClass, '\\')){
381
+        if (strpos($targetClass, '\\')) {
382 382
             $targetClass = (new \ReflectionClass($targetClass))->getShortName();
383 383
         }
384 384
         
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
             ->_AND_($linkSet->sourceId->is($source->id))
387 387
             ->_AND_($linkSet->targetClass->is($targetClass))
388 388
             ->_AND_($linkSet->targetId->is($this->id));
389
-        if(isset($linkType)){
390
-            if(is_array($linkType)){
389
+        if (isset($linkType)) {
390
+            if (is_array($linkType)) {
391 391
                 $criteria = $criteria->_AND_($linkSet->type->in($linkType));
392 392
             }
393
-            else{
393
+            else {
394 394
                 $criteria = $criteria->_AND_($linkSet->type->is($linkType));
395 395
             }
396 396
         }
@@ -413,22 +413,22 @@  discard block
 block discarded – undo
413 413
         $linkSet = $App->LinkSet();
414 414
         
415 415
         $sourceClass = $this->getClassName();
416
-        if(strpos($sourceClass, '\\')){
416
+        if (strpos($sourceClass, '\\')) {
417 417
             $targetClass = (new \ReflectionClass($sourceClass))->getShortName();
418 418
         }
419 419
         
420 420
         $targetClass = $target->getClassName();
421
-        if(strpos($targetClass, '\\')){
421
+        if (strpos($targetClass, '\\')) {
422 422
             $targetClass = (new \ReflectionClass($targetClass))->getShortName();
423 423
         }
424 424
         
425 425
         $criteria = $linkSet->all($linkSet->targetClass->is($targetClass), $linkSet->targetId->is($target->id), $linkSet->sourceClass->is($sourceClass), $linkSet->sourceId->is($this->id));
426 426
         
427
-        if(isset($linkType)){
428
-            if(is_array($linkType)){
427
+        if (isset($linkType)) {
428
+            if (is_array($linkType)) {
429 429
                 $criteria = $criteria->_AND_($linkSet->type->in($linkType));
430 430
             }
431
-            else{
431
+            else {
432 432
                 $criteria = $criteria->_AND_($linkSet->type->is($linkType));
433 433
             }
434 434
         }
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
      */
491 491
     protected function importProperty($name, $value)
492 492
     {
493
-        if(((string) $this->$name) !== ((string) $value)){
493
+        if (((string) $this->$name) !== ((string) $value)) {
494 494
             $this->$name = $value;
495 495
             return 1;
496 496
         }
@@ -510,13 +510,13 @@  discard block
 block discarded – undo
510 510
      */
511 511
     protected function importDate($name, $value)
512 512
     {
513
-        if(preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $value)){
513
+        if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $value)) {
514 514
             return $this->importProperty($name, $value);
515 515
         }
516 516
         
517 517
         // try in DD/MM/YYYY format
518 518
         
519
-        if(preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/', $value, $matches)){
519
+        if (preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/', $value, $matches)) {
520 520
             
521 521
             $value = sprintf('%04d-%02d-%02d', (int) $matches['year'], (int) $matches['month'], (int) $matches['day']);
522 522
             
@@ -536,11 +536,11 @@  discard block
 block discarded – undo
536 536
         $customContainers->groupBy($customContainerSet->view);
537 537
         
538 538
         $views = array();
539
-        foreach ($customContainers as $customContainer){
539
+        foreach ($customContainers as $customContainer) {
540 540
             $views[] = $customContainer->view;
541 541
         }
542 542
         
543
-        if(empty($views)){
543
+        if (empty($views)) {
544 544
             $views[] = '';
545 545
         }
546 546
         
@@ -624,9 +624,9 @@  discard block
 block discarded – undo
624 624
      */
625 625
     public function requireReadable($message = null)
626 626
     {
627
-        if(! $this->isReadable()){
627
+        if (!$this->isReadable()) {
628 628
             $App = $this->App();
629
-            if(! isset($message)){
629
+            if (!isset($message)) {
630 630
                 $message = $App->translate('Access denied');
631 631
             }
632 632
             throw new AppAccessException($message);
@@ -642,9 +642,9 @@  discard block
 block discarded – undo
642 642
      */
643 643
     public function requireUpdatable($message = null)
644 644
     {
645
-        if(! $this->isUpdatable()){
645
+        if (!$this->isUpdatable()) {
646 646
             $App = $this->App();
647
-            if(! isset($message)){
647
+            if (!isset($message)) {
648 648
                 $message = $App->translate('Access denied');
649 649
             }
650 650
             throw new AppAccessException($message);
@@ -660,9 +660,9 @@  discard block
 block discarded – undo
660 660
      */
661 661
     public function requireDeletable($message = null)
662 662
     {
663
-        if(! $this->isDeletable()){
663
+        if (!$this->isDeletable()) {
664 664
             $App = $this->App();
665
-            if(! isset($message)){
665
+            if (!isset($message)) {
666 666
                 $message = $App->translate('Access denied');
667 667
             }
668 668
             throw new AppAccessException($message);
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 
672 672
     public function getFrontId()
673 673
     {
674
-        if($this->getParentSet()->usesWebIdTrait()){
674
+        if ($this->getParentSet()->usesWebIdTrait()) {
675 675
             return $this->webId;
676 676
         }
677 677
         return $this->id;
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
     public function getFormOutputValues()
687 687
     {
688 688
         $values = parent::getFormOutputValues();
689
-        if($this->getParentSet()->usesWebIdTrait()){
689
+        if ($this->getParentSet()->usesWebIdTrait()) {
690 690
             $values['id'] = $this->webId;
691 691
             unset($values['webId']);
692 692
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             $sClassName = $field->getForeignSetName();
74 74
             if($field instanceof AppFkField){
75 75
                 $App = $field->App();
76
-            }else{
76
+            } else{
77 77
                 $App = $this->App();
78 78
             }
79 79
             $set = $App->$sClassName();
@@ -389,8 +389,7 @@  discard block
 block discarded – undo
389 389
         if(isset($linkType)){
390 390
             if(is_array($linkType)){
391 391
                 $criteria = $criteria->_AND_($linkSet->type->in($linkType));
392
-            }
393
-            else{
392
+            } else{
394 393
                 $criteria = $criteria->_AND_($linkSet->type->is($linkType));
395 394
             }
396 395
         }
@@ -427,8 +426,7 @@  discard block
 block discarded – undo
427 426
         if(isset($linkType)){
428 427
             if(is_array($linkType)){
429 428
                 $criteria = $criteria->_AND_($linkSet->type->in($linkType));
430
-            }
431
-            else{
429
+            } else{
432 430
                 $criteria = $criteria->_AND_($linkSet->type->is($linkType));
433 431
             }
434 432
         }
Please login to merge, or discard this patch.
programs/Set/AppNotification.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         $App = $this->App();
56 56
         $sseSet = $App->SSESet();
57
-        $sseSet->newReloadSelector('.' . self::NOTIFICATION_PORTLET_CLASS);
57
+        $sseSet->newReloadSelector('.'.self::NOTIFICATION_PORTLET_CLASS);
58 58
         $sseSet->newBrowserNotification(array(
59 59
             'title' => $this->title,
60 60
             'body' => $this->description,
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $this->seen = true;
70 70
         $this->save();
71 71
         $sseSet = $this->App()->SSESet();
72
-        $sseSet->newReloadSelector('.' . self::NOTIFICATION_PORTLET_CLASS);
72
+        $sseSet->newReloadSelector('.'.self::NOTIFICATION_PORTLET_CLASS);
73 73
         return true;
74 74
     }
75 75
 }
Please login to merge, or discard this patch.
programs/Set/AppCustomContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
                     $criteria = $field->$op($value);
108 108
                 } else {
109 109
                     foreach ($value as $foreignClassName => $foreignValues) {
110
-                        $foreignClassName = str_replace($App->classPrefix, '', $foreignClassName) . 'Set';
110
+                        $foreignClassName = str_replace($App->classPrefix, '', $foreignClassName).'Set';
111 111
                         $foreignSet = $App->$foreignClassName();
112 112
                         $foreignField = '';
113 113
                         $foreignCondition = '';
Please login to merge, or discard this patch.
programs/Ui/AppRecordView.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         $displayFieldName = $displayField['fieldname'];
347 347
         $parameters = $displayField['parameters'];
348 348
         $label = isset($parameters['label']) && !empty($parameters['label']) ? $parameters['label'] : null;
349
-        $displayFieldMethod = '_' . $displayFieldName;
349
+        $displayFieldMethod = '_'.$displayFieldName;
350 350
         if (!$isGroupField && method_exists($this, $displayFieldMethod)) {
351 351
             $item = $this->$displayFieldMethod($customSection, $label);
352 352
         } else {
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
                     '',
413 413
                     $this->record->getController()->editSection($this->record->getFrontId(), $customSection->id)
414 414
                 )->addClass('widget-actionbutton', 'section-button', 'icon', FuncIcons::ACTIONS_DOCUMENT_EDIT)
415
-                    ->setOpenMode(WidgetLink::OPEN_DIALOG)->setDialogClass('customSectionEditorDialog ' . $customSection->classname . ' '.$customSection->editDialogClass)
415
+                    ->setOpenMode(WidgetLink::OPEN_DIALOG)->setDialogClass('customSectionEditorDialog '.$customSection->classname.' '.$customSection->editDialogClass)
416 416
             );
417 417
         }
418 418
 
@@ -603,9 +603,9 @@  discard block
 block discarded – undo
603 603
 
604 604
                 $displayFieldName = $field['fieldname'];
605 605
 
606
-                $displayFieldMethod = '_' . $displayFieldName;
606
+                $displayFieldMethod = '_'.$displayFieldName;
607 607
 
608
-                if(strpos($displayFieldMethod, '__subSection') !== false){
608
+                if (strpos($displayFieldMethod, '__subSection') !== false) {
609 609
                     $item = $this->__subSection($customSection, $field);
610 610
                 } elseif (method_exists($this, $displayFieldMethod)) {
611 611
                     $item = $this->$displayFieldMethod($customSection, $labelField);
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
 
646 646
         $box = $W->FlexItems()->setGrowable(true)->setWrap(WidgetFlexLayout::FLEX_WRAP_WRAP)->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL);
647 647
 
648
-        if(isset($fieldDefinition['fields'])){
648
+        if (isset($fieldDefinition['fields'])) {
649 649
             foreach ($fieldDefinition['fields'] as $field) {
650 650
                 $item = null;
651 651
                 $parameters = $field['parameters'];
@@ -656,9 +656,9 @@  discard block
 block discarded – undo
656 656
 
657 657
                 $displayFieldName = $field['fieldname'];
658 658
 
659
-                $displayFieldMethod = '_' . $displayFieldName;
659
+                $displayFieldMethod = '_'.$displayFieldName;
660 660
 
661
-                if(strpos($displayFieldMethod, '__fieldsGroup') !== false){
661
+                if (strpos($displayFieldMethod, '__fieldsGroup') !== false) {
662 662
                     $item = $this->__fieldsGroup($customSection, $field);
663 663
                 } elseif (method_exists($this, $displayFieldMethod)) {
664 664
                     $item = $this->$displayFieldMethod($customSection, $labelField);
Please login to merge, or discard this patch.
programs/Ui/AppUi.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -61,22 +61,22 @@  discard block
 block discarded – undo
61 61
         $App = $this->App();
62 62
         $Ui = $App->Ui();
63 63
         
64
-        if(strpos($name, $App->classPrefix) !== false){
64
+        if (strpos($name, $App->classPrefix) !== false) {
65 65
             list(, $name) = explode($App->classPrefix, $name);
66 66
         }
67 67
         
68
-        if(method_exists($Ui, $name)){
68
+        if (method_exists($Ui, $name)) {
69 69
             return call_user_func_array(array($Ui, $name), $arguments);
70 70
         }
71 71
         
72 72
         $components = $App->getComponents();
73
-        foreach ($components as $component){
74
-            try{
73
+        foreach ($components as $component) {
74
+            try {
75 75
                 $componentUi = $component->ui();
76
-                if(isset($componentUi) && method_exists($componentUi, $name)){
76
+                if (isset($componentUi) && method_exists($componentUi, $name)) {
77 77
                     return call_user_func_array(array($componentUi, $name), $arguments);
78 78
                 }
79
-            }catch(Exception $e){}
79
+            } catch (Exception $e) {}
80 80
         }
81 81
         
82 82
         $rc = new \ReflectionClass($this);
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
         $page->addMessageInfo();
98 98
         
99 99
         $addon = $App->getAddon();
100
-        if($addon){
100
+        if ($addon) {
101 101
             $components = $App->getComponents();
102
-            foreach ($components as $component){
102
+            foreach ($components as $component) {
103 103
                 $stylePath = $component->getStylePath();
104
-                if($stylePath){
104
+                if ($stylePath) {
105 105
                     $page->addStyleSheet($stylePath.'style.css');
106 106
                 }
107 107
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
                 if(isset($componentUi) && method_exists($componentUi, $name)){
77 77
                     return call_user_func_array(array($componentUi, $name), $arguments);
78 78
                 }
79
-            }catch(Exception $e){}
79
+            } catch(Exception $e){}
80 80
         }
81 81
         
82 82
         $rc = new \ReflectionClass($this);
Please login to merge, or discard this patch.
programs/Ui/AppRecordEditor.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 class AppRecordEditor extends AppEditor
48 48
 {
49
-    public function __construct(FuncApp $app, $id = null, WidgetLayout $layout = null,AppRecord $record = null)
49
+    public function __construct(FuncApp $app, $id = null, WidgetLayout $layout = null, AppRecord $record = null)
50 50
     {
51 51
         $this->record = $record;
52 52
         parent::__construct($app, $id, $layout);
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function __call($name, $arguments)
56 56
     {
57
-        if (substr($name, 0, 1) !== '_'){
57
+        if (substr($name, 0, 1) !== '_') {
58 58
             return parent::__call($name, $arguments);
59 59
         }
60 60
 
61
-        try{
61
+        try {
62 62
             $App = $this->App();
63 63
 
64 64
             $customSection = $arguments[0];
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             
84 84
             return $item;
85 85
         }
86
-        catch(Exception $e){
86
+        catch (Exception $e) {
87 87
             return null;
88 88
         }
89 89
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      */
101 101
     protected function getRecordSet()
102 102
     {
103
-        if(!isset($this->recordSet)){
103
+        if (!isset($this->recordSet)) {
104 104
             $this->recordSet = parent::getRecordSet();
105 105
         }
106 106
         return $this->recordSet;
@@ -316,14 +316,14 @@  discard block
 block discarded – undo
316 316
                     $sizePolicy = 'customsection-field-box ';
317 317
                     $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : '';
318 318
                     $sizePolicy .= isset($parameters['transparentBackground']) && $parameters['transparentBackground'] ? 'customsection-field-box-transparentBackground' : '';
319
-                    $displayFieldMethod = '_' . $displayFieldName;
319
+                    $displayFieldMethod = '_'.$displayFieldName;
320 320
     
321 321
                     if (!$isGroupField && method_exists($this, $displayFieldMethod)) {
322 322
                         $widget = $this->$displayFieldMethod($customSection, $label);
323 323
                         $item = $widget;
324 324
                     } 
325 325
                     else {
326
-                        if($isGroupField){
326
+                        if ($isGroupField) {
327 327
                             if (method_exists($this, '__fieldsGroup')) {
328 328
                                 $customSection->fieldsLayout = $groupFieldsLayout;
329 329
                                 $item = $this->__fieldsGroup($customSection, $displayField);
@@ -331,14 +331,14 @@  discard block
 block discarded – undo
331 331
                             }
332 332
                             $sizePolicy .= ' customsection-fieldsgroup-box';
333 333
                         }
334
-                        elseif($isSpacerField){
334
+                        elseif ($isSpacerField) {
335 335
                             list(, $spacerId) = explode('_spacer', $displayFieldId);
336 336
                             if (method_exists($this, '__spacer')) {
337 337
                                 $item = $this->__spacer($customSection, $spacerId, $label);
338 338
                             }
339 339
                         }
340
-                        else{
341
-                            try{
340
+                        else {
341
+                            try {
342 342
                                 $field = $recordSet->getField($displayFieldName);
343 343
                                 if ($label === '' || $label === '__') {
344 344
                                     $label = $field->getDescription();
@@ -400,14 +400,14 @@  discard block
 block discarded – undo
400 400
             $parameters = $displayField['parameters'];
401 401
             $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
402 402
             $label = isset($parameters['label']) && !empty($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : null;
403
-            $displayFieldMethod = '_' . $displayFieldName;
403
+            $displayFieldMethod = '_'.$displayFieldName;
404 404
             $sizePolicy = 'customsection-field-box ';
405 405
             $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : '';
406 406
             if (!$isGroupField && method_exists($this, $displayFieldMethod)) {
407 407
                 $item = $this->$displayFieldMethod($customSection, $label);
408 408
             }
409
-            else{
410
-                if($isGroupField){
409
+            else {
410
+                if ($isGroupField) {
411 411
                     if (method_exists($this, '__fieldsGroup')) {
412 412
                         $customSection->fieldsLayout = $groupFieldsLayout;
413 413
                         $item = $this->__fieldsGroup($customSection, $displayField);
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
                     }
416 416
                     $sizePolicy .= ' customsection-fieldsgroup-box';
417 417
                 }
418
-                else{
418
+                else {
419 419
                     try {
420 420
                         $field = $this->recordSet->getField($displayFieldName);
421 421
                         if (!isset($label) || empty($label)) {
@@ -462,17 +462,17 @@  discard block
 block discarded – undo
462 462
         $box = $W->FlexItems()->setGrowable(true)->setWrap(WidgetFlexLayout::FLEX_WRAP_WRAP);
463 463
         $recordSet = $this->getRecordSet();
464 464
         
465
-        if(isset($fieldDefinition['fields'])){
466
-            foreach ($fieldDefinition['fields'] as $field){
465
+        if (isset($fieldDefinition['fields'])) {
466
+            foreach ($fieldDefinition['fields'] as $field) {
467 467
                 $item = null;
468 468
                 
469 469
                 $labelField = isset($field['parameters']['label']) ? $field['parameters']['label'] : '';
470 470
                 $itemClass = isset($field['parameters']['classname']) ? $field['parameters']['classname'] : '';
471 471
                 $displayFieldName = $field['fieldname'];
472
-                $displayFieldMethod = '_' . $displayFieldName;
473
-                if(strpos($displayFieldMethod, '__subSection') !== false){
472
+                $displayFieldMethod = '_'.$displayFieldName;
473
+                if (strpos($displayFieldMethod, '__subSection') !== false) {
474 474
                     $item = $this->__subSection($customSection, $field);
475
-                    if(!isset($item) || count($item->getItems()) == 0){
475
+                    if (!isset($item) || count($item->getItems()) == 0) {
476 476
                         continue;
477 477
                     }
478 478
                 }elseif (method_exists($this, $displayFieldMethod)) {
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                     }
493 493
                     $item = $this->getValueItem($customSection, $field, $labelField, $item);
494 494
                 }
495
-                if(isset($item)){
495
+                if (isset($item)) {
496 496
                     $item->addClass('app-customsection-groupedfield');
497 497
                     $item->addClass($itemClass);
498 498
                     $box->addItem($item);
@@ -511,17 +511,17 @@  discard block
 block discarded – undo
511 511
         $box = $W->FlexItems()->setGrowable(true)->setWrap(WidgetFlexLayout::FLEX_WRAP_WRAP);
512 512
         $recordSet = $this->getRecordSet();
513 513
         
514
-        if(isset($fieldDefinition['fields'])){
515
-            foreach ($fieldDefinition['fields'] as $field){
514
+        if (isset($fieldDefinition['fields'])) {
515
+            foreach ($fieldDefinition['fields'] as $field) {
516 516
                 $item = null;
517 517
                 
518 518
                 $labelField = isset($field['parameters']['label']) ? $field['parameters']['label'] : '';
519 519
                 $itemClass = isset($field['parameters']['classname']) ? $field['parameters']['classname'] : '';
520 520
                 $displayFieldName = $field['fieldname'];
521
-                $displayFieldMethod = '_' . $displayFieldName;
522
-                if(strpos($displayFieldMethod, '__fieldsGroup') !== false){
521
+                $displayFieldMethod = '_'.$displayFieldName;
522
+                if (strpos($displayFieldMethod, '__fieldsGroup') !== false) {
523 523
                     $item = $this->__fieldsGroup($customSection, $field);
524
-                    if(count($item->getItems()) == 0){
524
+                    if (count($item->getItems()) == 0) {
525 525
                         continue;
526 526
                     }
527 527
                 }elseif (method_exists($this, $displayFieldMethod)) {
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
                     }
542 542
                     $item = $this->getValueItem($customSection, $field, $labelField, $item);
543 543
                 }
544
-                if(isset($item)){
544
+                if (isset($item)) {
545 545
                     $item->addClass('app-customsection-subsectionfield');
546 546
                     $item->addClass($itemClass);
547 547
                     $box->addItem($item);
Please login to merge, or discard this patch.
Braces   +10 added lines, -18 removed lines patch added patch discarded remove patch
@@ -82,8 +82,7 @@  discard block
 block discarded – undo
82 82
             $item = $this->getValueItem($customSection, array(), $label, $widget);
83 83
             
84 84
             return $item;
85
-        }
86
-        catch(Exception $e){
85
+        } catch(Exception $e){
87 86
             return null;
88 87
         }
89 88
 
@@ -321,8 +320,7 @@  discard block
 block discarded – undo
321 320
                     if (!$isGroupField && method_exists($this, $displayFieldMethod)) {
322 321
                         $widget = $this->$displayFieldMethod($customSection, $label);
323 322
                         $item = $widget;
324
-                    } 
325
-                    else {
323
+                    } else {
326 324
                         if($isGroupField){
327 325
                             if (method_exists($this, '__fieldsGroup')) {
328 326
                                 $customSection->fieldsLayout = $groupFieldsLayout;
@@ -330,14 +328,12 @@  discard block
 block discarded – undo
330 328
                                 $customSection->fieldsLayout = $originalFieldsLayout;
331 329
                             }
332 330
                             $sizePolicy .= ' customsection-fieldsgroup-box';
333
-                        }
334
-                        elseif($isSpacerField){
331
+                        } elseif($isSpacerField){
335 332
                             list(, $spacerId) = explode('_spacer', $displayFieldId);
336 333
                             if (method_exists($this, '__spacer')) {
337 334
                                 $item = $this->__spacer($customSection, $spacerId, $label);
338 335
                             }
339
-                        }
340
-                        else{
336
+                        } else{
341 337
                             try{
342 338
                                 $field = $recordSet->getField($displayFieldName);
343 339
                                 if ($label === '' || $label === '__') {
@@ -405,8 +401,7 @@  discard block
 block discarded – undo
405 401
             $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : '';
406 402
             if (!$isGroupField && method_exists($this, $displayFieldMethod)) {
407 403
                 $item = $this->$displayFieldMethod($customSection, $label);
408
-            }
409
-            else{
404
+            } else{
410 405
                 if($isGroupField){
411 406
                     if (method_exists($this, '__fieldsGroup')) {
412 407
                         $customSection->fieldsLayout = $groupFieldsLayout;
@@ -414,8 +409,7 @@  discard block
 block discarded – undo
414 409
                         $customSection->fieldsLayout = $wantedFieldsLayout;
415 410
                     }
416 411
                     $sizePolicy .= ' customsection-fieldsgroup-box';
417
-                }
418
-                else{
412
+                } else{
419 413
                     try {
420 414
                         $field = $this->recordSet->getField($displayFieldName);
421 415
                         if (!isset($label) || empty($label)) {
@@ -475,10 +469,9 @@  discard block
 block discarded – undo
475 469
                     if(!isset($item) || count($item->getItems()) == 0){
476 470
                         continue;
477 471
                     }
478
-                }elseif (method_exists($this, $displayFieldMethod)) {
472
+                } elseif (method_exists($this, $displayFieldMethod)) {
479 473
                     $item = $this->$displayFieldMethod($customSection, $labelField);
480
-                }
481
-                else if ($recordSet->fieldExist($displayFieldName)) {
474
+                } else if ($recordSet->fieldExist($displayFieldName)) {
482 475
                     $field = $recordSet->getField($displayFieldName);
483 476
                     if ($labelField === '') {
484 477
                         $labelField = $field->getDescription();
@@ -524,10 +517,9 @@  discard block
 block discarded – undo
524 517
                     if(count($item->getItems()) == 0){
525 518
                         continue;
526 519
                     }
527
-                }elseif (method_exists($this, $displayFieldMethod)) {
520
+                } elseif (method_exists($this, $displayFieldMethod)) {
528 521
                     $item = $this->$displayFieldMethod($customSection, $labelField);
529
-                }
530
-                else if ($recordSet->fieldExist($displayFieldName)) {
522
+                } else if ($recordSet->fieldExist($displayFieldName)) {
531 523
                     $field = $recordSet->getField($displayFieldName);
532 524
                     if ($labelField === '') {
533 525
                         $labelField = $field->getDescription();
Please login to merge, or discard this patch.
programs/Ui/AppEditor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         $this->record = $record;
204 204
         if ($name = $this->getName()) {
205 205
             $values = $record->getFormOutputValues();
206
-            if($record->getParentSet()->usesWebIdTrait()){
206
+            if ($record->getParentSet()->usesWebIdTrait()) {
207 207
                 $values['id'] = $record->getFrontId();
208 208
             }
209 209
             $this->setValues($values, array($name));
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                 );
355 355
         }
356 356
         
357
-        foreach($this->btnInfos as $btnInfo){
357
+        foreach ($this->btnInfos as $btnInfo) {
358 358
             $this->addButton($btnInfo['label']);
359 359
             $this->addButton($btnInfo['button']);
360 360
         }
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
         $submitButton = $W->SubmitButton()
369 369
         ->setAction($action)
370 370
         ->setLabel($label);
371
-        if(!empty($class)){
371
+        if (!empty($class)) {
372 372
             $submitButton->addClass($class);
373 373
         }
374 374
         if ($this->isAjax) {
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
         $label = $W->Label($label);
378 378
         $label->setAssociatedWidget($submitButton);
379 379
         $label->addClass($submitButton->getClasses());
380
-        if(!empty($icon)){
380
+        if (!empty($icon)) {
381 381
             $label->setIcon($icon);
382 382
         }
383 383
         $submitButton->addAttribute('style', 'display:none');
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
         $this->appendFields();
511 511
         $this->appendButtons();
512 512
 
513
-        if(!empty($this->submitToastInfos)){
513
+        if (!empty($this->submitToastInfos)) {
514 514
             $this->item->setMetadata('submitToastInfos', $this->submitToastInfos);
515 515
         }
516 516
 
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
         return $display;
523 523
     }
524 524
 
525
-    public function setAjaxMode($isAjax = true){
525
+    public function setAjaxMode($isAjax = true) {
526 526
         $this->isAjax = $isAjax;
527 527
         return $this;
528 528
     }
Please login to merge, or discard this patch.