Passed
Branchfeature/useWidgetsNamespaces (eb4650)
by Robin
02:57
created
programs/AppUiObject.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,18 +76,18 @@
 block discarded – undo
76 76
     public function __call($name, $arguments)
77 77
     {
78 78
         // We delegate all undefined methods to the $item object.
79
-        if(isset($this->item)){
79
+        if (isset($this->item)) {
80 80
             $returnedValue = call_user_func_array(array(
81 81
                 $this->item,
82 82
                 $name
83 83
             ), $arguments);
84
-            if($returnedValue === $this->item){
84
+            if ($returnedValue === $this->item) {
85 85
                 $returnedValue = $this;
86 86
             }
87 87
             return $returnedValue;
88 88
         }
89
-        else{
90
-            trigger_error('the method ' . $name . ' does not exists on ' . get_class($this) . ' and there is no widget defined with the setInheritedItem method');
89
+        else {
90
+            trigger_error('the method '.$name.' does not exists on '.get_class($this).' and there is no widget defined with the setInheritedItem method');
91 91
         }
92 92
     }
93 93
     
Please login to merge, or discard this patch.
programs/Ui/AppCustomFieldEditor.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
         
51 51
         $this->setHiddenValue('tg', $App->controllerTg);
52 52
         
53
-        if(isset($customfield)){
53
+        if (isset($customfield)) {
54 54
             $this->setHiddenValue('customfield[id]', $customfield->id);
55 55
             $values = $customfield->getValues();
56 56
             
57
-            if(! empty($this->customfield->enumvalues)){
57
+            if (!empty($this->customfield->enumvalues)) {
58 58
                 $values['enumvalues'] = unserialize($this->customfield->enumvalues);
59 59
             }
60
-            else{
60
+            else {
61 61
                 $values['enumvalues'] = array(
62 62
                     '0' => ''
63 63
                 );
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $this->addItem($this->searchable());
83 83
         $this->addItem($this->visible());
84 84
         $this->addItem($this->importable());
85
-        if($App->onlineShop){
85
+        if ($App->onlineShop) {
86 86
             $this->addItem($this->visible_in_shop());
87 87
         }
88 88
     }
@@ -175,16 +175,16 @@  discard block
 block discarded – undo
175 175
         $fieldValuesItem->addItem($W->Label($App->translate('List of available values')));
176 176
         $values = array();
177 177
         
178
-        if(isset($this->customfield) && ! empty($this->customfield->enumvalues)){
178
+        if (isset($this->customfield) && !empty($this->customfield->enumvalues)) {
179 179
             $values = unserialize($this->customfield->enumvalues);
180 180
             
181
-            foreach ($values as $name => $text){
181
+            foreach ($values as $name => $text) {
182 182
                 $fieldValuesItem->addItem($W->LineEdit()
183 183
                     ->setName((string) $name));
184 184
             }
185 185
         }
186 186
         
187
-        if(empty($values)){
187
+        if (empty($values)) {
188 188
             $fieldValuesItem->addItem($W->LineEdit()
189 189
                 ->setName('1'));
190 190
         }
Please login to merge, or discard this patch.
programs/Ui/AppTableModelViewColumnSettingsEditor.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $this->modelView = $modelView;
44 44
         $this->modelViewId = $modelView->getId();
45
-        if(! isset($id) || empty($id)){
45
+        if (!isset($id) || empty($id)) {
46 46
             $id = $this->getDefaultEditorId();
47 47
         }
48 48
         parent::__construct($app, $id, $layout);
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
         );
95 95
         
96 96
         $select = $W->Select();
97
-        foreach ($pagesLengths as $pagesLength){
97
+        foreach ($pagesLengths as $pagesLength) {
98 98
             $select->addOption($pagesLength, $pagesLength);
99 99
         }
100
-        $select->setValue($W->getUserConfiguration($this->modelViewId . '/pageLength', 'widgets'));
100
+        $select->setValue($W->getUserConfiguration($this->modelViewId.'/pageLength', 'widgets'));
101 101
         
102 102
         return $W->LabelledWidget($this->App()
103 103
             ->translate('Number of lines per page'), $select, 'pageLength')
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         $W = bab_Widgets();
110 110
         
111 111
         $checkbox = $W->CheckBox();
112
-        $checkbox->setValue($W->getUserConfiguration($this->modelViewId . '/displaySubTotalRow', 'widgets'));
112
+        $checkbox->setValue($W->getUserConfiguration($this->modelViewId.'/displaySubTotalRow', 'widgets'));
113 113
         
114 114
         return $W->LabelledWidget($this->App()
115 115
             ->translate('Display subtotal rows'), $checkbox, 'displaySubTotalRow')
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
             ->setWrap(WidgetFlexLayout::FLEX_WRAP_WRAP)));
140 140
         $col = 0;
141 141
         
142
-        foreach ($columns as $path => $column){
142
+        foreach ($columns as $path => $column) {
143 143
             
144
-            if(! $column->isInList()){
144
+            if (!$column->isInList()) {
145 145
                 continue;
146 146
             }
147
-            if($column->isSelectable() && $column->getSelectableName() != ''){
147
+            if ($column->isSelectable() && $column->getSelectableName() != '') {
148 148
                 $columnList->addItem($W->FlexItems($labelledWidget = $W->LabelledWidget($column->getSelectableName(), $W->CheckBox()
149 149
                     ->setValue($column->isVisible()), array(
150 150
                     'columns',
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                     ->addAttribute('style', 'flex-grow: 1; width: 33%;'));
156 156
                 $labelledWidget->getLabelWidget()->addClass('columnListElementLabel');
157 157
             }
158
-            $col ++;
158
+            $col++;
159 159
         }
160 160
         
161 161
         return $columnsBox;
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $W = $this->widgets;
174 174
         $App = $this->App();
175 175
         
176
-        if(isset($this->saveAction)){
176
+        if (isset($this->saveAction)) {
177 177
             $saveLabel = isset($this->saveLabel) ? $this->saveLabel : $App->translate('Save');
178 178
             $submitButton = $W->SubmitButton();
179 179
             $submitButton->validate()
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
                 ->setFailedAction($this->failedAction)
182 182
                 ->setSuccessAction($this->successAction)
183 183
                 ->setLabel($saveLabel);
184
-            if($this->isAjax){
184
+            if ($this->isAjax) {
185 185
                 $submitButton->setAjaxAction();
186 186
             }
187 187
             $this->addButton($submitButton);
188 188
         }
189 189
         
190
-        if(isset($this->resetAction)){
190
+        if (isset($this->resetAction)) {
191 191
             $resetLabel = isset($this->resetLabel) ? $this->resetLabel : $App->translate('Reset default columns');
192 192
             $resetButton = $W->SubmitButton();
193 193
             $resetButton->validate()
@@ -196,13 +196,13 @@  discard block
 block discarded – undo
196 196
                 ->setSuccessAction($this->resetAction)
197 197
                 ->addClass('resetButton')
198 198
                 ->setLabel($resetLabel);
199
-            if($this->isAjax){
199
+            if ($this->isAjax) {
200 200
                 $resetButton->setAjaxAction();
201 201
             }
202 202
             $this->addButton($resetButton);
203 203
         }
204 204
         
205
-        if(isset($this->cancelAction)){
205
+        if (isset($this->cancelAction)) {
206 206
             $cancelLabel = isset($this->cancelLabel) ? $this->cancelLabel : $App->translate('Cancel');
207 207
             $this->addButton($W->SubmitButton()
208 208
                 ->addClass('widget-close-dialog')
Please login to merge, or discard this patch.
programs/Ui/AppRecordFrame.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         $row = $W->Items()->setSizePolicy('row');
277 277
         foreach ($customSections as $customSection) {
278 278
 
279
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
279
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
280 280
 
281 281
             if ($currentColumn + $nbCol > 12) {
282 282
                 $this->addItem($row);
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                 $parameters = $displayField['parameters'];
304 304
                 $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
305 305
                 $label = isset($parameters['label']) ? $parameters['label'] : '';
306
-                $displayFieldMethod = '_' . $displayFieldName;
306
+                $displayFieldMethod = '_'.$displayFieldName;
307 307
 
308 308
                 if (method_exists($this, $displayFieldMethod)) {
309 309
                     $value = $this->$displayFieldMethod($customSection, $label);
Please login to merge, or discard this patch.
programs/Ui/Items/AppChip.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,14 +96,14 @@
 block discarded – undo
96 96
         
97 97
         $html = "<div class='chip'>";
98 98
         
99
-        if(isset($this->labelIcon)){
99
+        if (isset($this->labelIcon)) {
100 100
             $icon = $W->Label('')->setIconFormat(16, 'left')->setIcon($this->labelIcon);
101 101
             $html .= $icon->display($W->HtmlCanvas());
102 102
         }
103 103
         
104 104
         $html .= $this->label;
105 105
         
106
-        if(isset($this->action)){
106
+        if (isset($this->action)) {
107 107
             $icon = $W->Link('', $this->action)->setIconFormat(16, 'left')->setOpenMode(WidgetLink::OPEN_DIALOG_AND_RELOAD);
108 108
             $icon->setIcon(isset($this->actionIcon) ? $this->actionIcon : \Func_Icons::ACTIONS_DIALOG_CANCEL);
109 109
             $icon->addClass('chip-right-action');
Please login to merge, or discard this patch.
programs/Ui/Items/AppShapeTriangle.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     
29 29
     protected function getShapeHtml()
30 30
     {
31
-        $path = "M{$this->size} {$this->size} " . number_format($this->size / 2, 1) . ' ' . number_format($this->size / 6, 1) . " L0 {$this->size} Z";
31
+        $path = "M{$this->size} {$this->size} ".number_format($this->size / 2, 1).' '.number_format($this->size / 6, 1)." L0 {$this->size} Z";
32 32
         return "<svg height='{$this->size}' width='{$this->size}'>
33 33
             <path d='{$path}' fill='{$this->color}'/>
34 34
         </svg>";
Please login to merge, or discard this patch.
programs/Ui/AppToolbar.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     
37 37
     public function __construct($id = null, WidgetLayout $layout = null)
38 38
     {
39
-        if(! isset($layout)){
39
+        if (!isset($layout)) {
40 40
             $W = bab_Widgets();
41 41
             $layout = $W->FlowLayout()->setHorizontalSpacing(1, 'em');
42 42
             $layout->setVerticalAlign('top');
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $W = bab_Widgets();
58 58
         $button = $W->Link($labelText, $action, $id);
59
-        if(isset($iconName)){
59
+        if (isset($iconName)) {
60 60
             $button->addClass('icon', $iconName);
61 61
         }
62 62
         
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
     public function addInstantForm(WidgetDisplayableInterface $form, $labelText = null, $iconName = null, $action = null, $id = null)
69 69
     {
70 70
         $W = bab_Widgets();
71
-        if(isset($iconName)){
71
+        if (isset($iconName)) {
72 72
             $content = $W->Icon($labelText, $iconName);
73 73
         }
74
-        else{
74
+        else {
75 75
             $content = $labelText;
76 76
         }
77 77
         $button = $W->Link($content, $action, $id);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $this->addItem($W->VBoxItems($button->addClass('widget-instant-button'), $form->addClass('widget-instant-form'))
80 80
             ->addClass('widget-instant-container'));
81 81
         
82
-        if($form->getTitle() === null){
82
+        if ($form->getTitle() === null) {
83 83
             $form->setTitle($labelText);
84 84
         }
85 85
         
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
     
89 89
     public function display(WidgetCanvas $canvas)
90 90
     {
91
-        if(! $this->local){
91
+        if (!$this->local) {
92 92
             $this->addClass('widget-toolbar');
93 93
         }
94
-        else{
94
+        else {
95 95
             $this->addClass('app-toolbar');
96 96
         }
97 97
         $this->addClass(\Func_Icons::ICON_LEFT_16);
Please login to merge, or discard this patch.
programs/Ui/AppRecordView.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                     continue;
304 304
                 }
305 305
                 
306
-                list(, , $nbCol) = explode('-', $customSection->sizePolicy);
306
+                list(,, $nbCol) = explode('-', $customSection->sizePolicy);
307 307
                 
308 308
                 if ($currentColumn + $nbCol > 12) {
309 309
                     $container->addItem($row);
@@ -359,19 +359,19 @@  discard block
 block discarded – undo
359 359
                     $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : '';
360 360
                     $sizePolicy .= isset($parameters['transparentBackground']) && $parameters['transparentBackground'] ? 'customsection-field-box-transparentBackground' : '';
361 361
                     
362
-                    $displayFieldMethod = '_' . $displayFieldName;
362
+                    $displayFieldMethod = '_'.$displayFieldName;
363 363
                     if (!$isGroupField && method_exists($this, $displayFieldMethod)) {
364 364
                         $item = $this->$displayFieldMethod($customSection, $label);
365 365
                     }
366 366
                     else {
367
-                        if($isGroupField){
367
+                        if ($isGroupField) {
368 368
                             list(, $groupId) = explode('_fieldsGroup', $displayFieldId);
369 369
                             if (method_exists($this, '__fieldsGroup')) {
370 370
                                 $item = $this->__fieldsGroup($customSection, $groupId, $label);
371 371
                             }
372 372
                             $sizePolicy .= ' customsection-fieldsgroup-box';
373 373
                         }
374
-                        else{
374
+                        else {
375 375
                             try {
376 376
                                 $field = $this->recordSet->getField($displayFieldName);
377 377
                                 $value = $this->fieldOutput($field, $this->record, $displayFieldName);
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                 }
400 400
             }
401 401
             
402
-            if ($currentColumn + $nbCol> 0) {
402
+            if ($currentColumn + $nbCol > 0) {
403 403
                 $container->addItem($row);
404 404
             }
405 405
         }
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
         $groupField = $customSection->getField('_fieldsGroup'.$groupId);
432 432
         $originalFieldsLayout = $customSection->fieldsLayout;
433 433
         $customSection->fieldsLayout = AppCustomSection::FIELDS_LAYOUT_VERTICAL_LABEL;
434
-        if(isset($groupField['fields'])){
435
-            foreach ($groupField['fields'] as $field){
434
+        if (isset($groupField['fields'])) {
435
+            foreach ($groupField['fields'] as $field) {
436 436
                 $item = null;
437 437
                 $parameters = $field['parameters'];
438 438
                 $labelField = isset($parameters['label']) ? $parameters['label'] : '';
@@ -442,11 +442,11 @@  discard block
 block discarded – undo
442 442
                 
443 443
                 $displayFieldName = $field['fieldname'];
444 444
                 
445
-                $displayFieldMethod = '_' . $displayFieldName;
445
+                $displayFieldMethod = '_'.$displayFieldName;
446 446
                 if (method_exists($this, $displayFieldMethod)) {
447 447
                     $item = $this->$displayFieldMethod($customSection, $labelField);
448 448
                 }
449
-                else{
449
+                else {
450 450
                     try {
451 451
                         $field = $this->recordSet->getField($displayFieldName);
452 452
                         $value = $this->fieldOutput($field, $this->record, $displayFieldName);
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
                         $item = null;
463 463
                     }
464 464
                 }
465
-                if(isset($item)){
465
+                if (isset($item)) {
466 466
                     $item->addClass('app-customsection-groupedfield');
467 467
                     $item->addClass($itemClass);
468 468
                 }
Please login to merge, or discard this patch.
programs/Ui/AppExportSelectEditor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         
43 43
         $this->tableview = $tableview;
44 44
         
45
-        if(isset($filter)){
45
+        if (isset($filter)) {
46 46
             $this->setHiddenValues('filter', $filter);
47 47
         }
48 48
         $this->setHiddenValue('tg', $App->controllerTg);
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
         
110 110
         $columns = $this->tableview->getVisibleColumns();
111 111
         
112
-        foreach ($columns as $path => $column){
113
-            if(! $column->isExportable()){
112
+        foreach ($columns as $path => $column) {
113
+            if (!$column->isExportable()) {
114 114
                 continue;
115 115
             }
116 116
             $columnList->addItem($W->FlexItems($W->LabelledWidget($column->getSelectableName(), $checkbox = $W->CheckBox()
Please login to merge, or discard this patch.