Passed
Branchfeature/useWidgetsNamespaces (b6928f)
by Robin
03:02
created
programs/Set/AppNotification.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $App = $this->App();
45 45
         $sseSet = $App->SSESet();
46
-        $sseSet->newReloadSelector('.' . self::NOTIFICATION_PORTLET_CLASS);
46
+        $sseSet->newReloadSelector('.'.self::NOTIFICATION_PORTLET_CLASS);
47 47
         $sseSet->newBrowserNotification(array(
48 48
             'title' => $this->title,
49 49
             'body' => $this->description,
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $this->seen = true;
59 59
         $this->save();
60 60
         $sseSet = $this->App()->SSESet();
61
-        $sseSet->newReloadSelector('.' . self::NOTIFICATION_PORTLET_CLASS);
61
+        $sseSet->newReloadSelector('.'.self::NOTIFICATION_PORTLET_CLASS);
62 62
         return true;
63 63
     }
64 64
 }
65 65
\ No newline at end of file
Please login to merge, or discard this patch.
programs/AppUiObject.php 2 patches
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.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,8 +85,7 @@
 block discarded – undo
85 85
                 $returnedValue = $this;
86 86
             }
87 87
             return $returnedValue;
88
-        }
89
-        else{
88
+        } else{
90 89
             trigger_error('the method ' . $name . ' does not exists on ' . get_class($this) . ' and there is no widget defined with the setInheritedItem method');
91 90
         }
92 91
     }
Please login to merge, or discard this patch.
programs/Ui/AppCustomFieldEditor.php 2 patches
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.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@
 block discarded – undo
56 56
             
57 57
             if(! empty($this->customfield->enumvalues)){
58 58
                 $values['enumvalues'] = unserialize($this->customfield->enumvalues);
59
-            }
60
-            else{
59
+            } else{
61 60
                 $values['enumvalues'] = array(
62 61
                     '0' => ''
63 62
                 );
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/AppUi.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
                 if(isset($componentUi) && method_exists($componentUi, $name)){
63 63
                     return call_user_func_array(array($componentUi, $name), $arguments);
64 64
                 }
65
-            }catch(\Exception $e){}
65
+            } catch(\Exception $e){}
66 66
         }
67 67
         
68 68
         $rc = new \ReflectionClass($this);
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,22 +47,22 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $App = $this->App();
49 49
         $Ui = $App->Ui();
50
-        if(strpos($name, $App->classPrefix) !== false){
50
+        if (strpos($name, $App->classPrefix) !== false) {
51 51
             list(, $name) = explode($App->classPrefix, $name);
52 52
         }
53 53
         
54
-        if(method_exists($Ui, $name)){
54
+        if (method_exists($Ui, $name)) {
55 55
             return call_user_func_array(array($Ui, $name), $arguments);
56 56
         }
57 57
         
58 58
         $components = $App->getComponents();
59
-        foreach ($components as $component){
60
-            try{
59
+        foreach ($components as $component) {
60
+            try {
61 61
                 $componentUi = $component->ui();
62
-                if(isset($componentUi) && method_exists($componentUi, $name)){
62
+                if (isset($componentUi) && method_exists($componentUi, $name)) {
63 63
                     return call_user_func_array(array($componentUi, $name), $arguments);
64 64
                 }
65
-            }catch(\Exception $e){}
65
+            } catch (\Exception $e) {}
66 66
         }
67 67
         
68 68
         $rc = new \ReflectionClass($this);
@@ -83,11 +83,11 @@  discard block
 block discarded – undo
83 83
         $page->addMessageInfo();
84 84
         
85 85
         $addon = $App->getAddon();
86
-        if($addon){
86
+        if ($addon) {
87 87
             $components = $App->getComponents();
88
-            foreach ($components as $component){
88
+            foreach ($components as $component) {
89 89
                 $stylePath = $component->getStylePath();
90
-                if($stylePath){
90
+                if ($stylePath) {
91 91
                     $page->addStyleSheet($stylePath.'style.css');
92 92
                 }
93 93
             }
Please login to merge, or discard this patch.
programs/Ui/AppToolbar.php 2 patches
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.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,8 +70,7 @@  discard block
 block discarded – undo
70 70
         $W = bab_Widgets();
71 71
         if(isset($iconName)){
72 72
             $content = $W->Icon($labelText, $iconName);
73
-        }
74
-        else{
73
+        } else{
75 74
             $content = $labelText;
76 75
         }
77 76
         $button = $W->Link($content, $action, $id);
@@ -90,8 +89,7 @@  discard block
 block discarded – undo
90 89
     {
91 90
         if(! $this->local){
92 91
             $this->addClass('widget-toolbar');
93
-        }
94
-        else{
92
+        } else{
95 93
             $this->addClass('app-toolbar');
96 94
         }
97 95
         $this->addClass(\Func_Icons::ICON_LEFT_16);
Please login to merge, or discard this patch.