Completed
Branch master (9a3508)
by Alfred
02:51 queued 01:04
created
Elements/Datalist.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,9 @@
 block discarded – undo
30 30
         $html .= '<datalist id="'. $this->listname.'">';
31 31
         foreach( $this->options as $option)
32 32
         {
33
-            if(!$option = trim(strip_tags($option))) continue;
33
+            if(!$option = trim(strip_tags($option))) {
34
+              continue;
35
+            }
34 36
             $html .= '<option value="'.$option.'">';
35 37
         }
36 38
         $html .= '</datalist>';
Please login to merge, or discard this patch.
Elements/Checkbox.php 1 patch
Braces   +20 added lines, -13 removed lines patch added patch discarded remove patch
@@ -37,28 +37,33 @@  discard block
 block discarded – undo
37 37
         $html = '';
38 38
         if($this->Types()->has($this->Attributes()->get('type')))
39 39
         {
40
-            if(!$this->Attributes()->has('id'))
41
-                $this->Attributes()->createElementID($this->Attributes()->get('name',$this->label()->getItemID()));
40
+            if(!$this->Attributes()->has('id')) {
41
+                            $this->Attributes()->createElementID($this->Attributes()->get('name',$this->label()->getItemID()));
42
+            }
42 43
             $this->label()->Attribute()->set('fieldtype',$this->Attributes()->get('type'));
43 44
             $this->label()->Attribute()->set('for',$this->Attributes()->get('id'));
44 45
             if(sizeof($this->options)<2)
45 46
             {
46
-                if($this->Attributes()->get('value'))
47
-                    $this->Attributes()->set('checked','checked');
47
+                if($this->Attributes()->get('value')) {
48
+                                    $this->Attributes()->set('checked','checked');
49
+                }
48 50
                 $this->Attributes()->set('value','1');
49 51
                 $this->hiddenInput = new Hidden($this->Label(),['value'=>'0']);
50 52
             }
51
-            if($this->hiddenInput instanceof FormElementInterface)
52
-                return  parent::RenderHtml().$this->hiddenInput->RenderHtml();
53
+            if($this->hiddenInput instanceof FormElementInterface) {
54
+                            return  parent::RenderHtml().$this->hiddenInput->RenderHtml();
55
+            }
53 56
             if($this->Attributes()->has('value'))
54 57
             {
55
-                if(!is_array($this->Attributes()->get('value')))
56
-                    $this->Attributes()->set('value',[$this->Attributes()->get('value')]);
58
+                if(!is_array($this->Attributes()->get('value'))) {
59
+                                    $this->Attributes()->set('value',[$this->Attributes()->get('value')]);
60
+                }
61
+            } else {
62
+                            $this->Attributes()->set('value',[]);
63
+            }
64
+            if(substr($this->Attributes()->get('name'), -2) !== '[]') {
65
+                            $this->Attributes()->set('name',$this->Attributes()->get('name').'[]');
57 66
             }
58
-            else
59
-                $this->Attributes()->set('value',[]);
60
-            if(substr($this->Attributes()->get('name'), -2) !== '[]')
61
-                $this->Attributes()->set('name',$this->Attributes()->get('name').'[]');
62 67
             $count = 0;
63 68
             $html .= $this->Label()->RenderHtml();
64 69
             $this->Attributes()->Ignore(['id', 'value', 'checked', 'required']);
@@ -68,7 +73,9 @@  discard block
 block discarded – undo
68 73
                 $html .= '<input id="'.$this->Attributes()->get('id').'-'.$count.'"';
69 74
                 $html .= ' value="'.$index.'"';
70 75
                 $html .= $this->Attributes()->RenderHtml();
71
-                if(in_array($index , $this->Attributes()->get('value'))) $html .= ' checked="checked"';
76
+                if(in_array($index , $this->Attributes()->get('value'))) {
77
+                  $html .= ' checked="checked"';
78
+                }
72 79
                 $html .= ' >'.$details.'</label>';
73 80
                 ++$count;
74 81
             }
Please login to merge, or discard this patch.
Elements/Number.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,14 +19,17 @@
 block discarded – undo
19 19
 
20 20
         $this->attributes->set('type','number');
21 21
 
22
-        if(!$this->attributes->has('min'))
23
-            $this->attributes->set('min','0');
22
+        if(!$this->attributes->has('min')) {
23
+                    $this->attributes->set('min','0');
24
+        }
24 25
 
25
-        if(!$this->attributes->has('max'))
26
-            $this->attributes->set('max','100');
26
+        if(!$this->attributes->has('max')) {
27
+                    $this->attributes->set('max','100');
28
+        }
27 29
 
28
-        if(!$this->attributes->has('step'))
29
-            $this->attributes->set('step','1');
30
+        if(!$this->attributes->has('step')) {
31
+                    $this->attributes->set('step','1');
32
+        }
30 33
     }
31 34
 
32 35
 }
33 36
\ No newline at end of file
Please login to merge, or discard this patch.
Elements/Select.php 1 patch
Braces   +32 added lines, -21 removed lines patch added patch discarded remove patch
@@ -37,40 +37,45 @@  discard block
 block discarded – undo
37 37
         $html = '';
38 38
         $multiple=false;
39 39
 
40
-        if (!$this->Attributes()->has('id'))
41
-            $this->Attributes()->createElementID($this->Attributes()->get('name', $this->label()->getItemID()));
40
+        if (!$this->Attributes()->has('id')) {
41
+                    $this->Attributes()->createElementID($this->Attributes()->get('name', $this->label()->getItemID()));
42
+        }
42 43
         $this->label()->Attribute()->set('fieldtype', $this->Attributes()->get('type'));
43 44
         $this->label()->Attribute()->set('for', $this->Attributes()->get('id'));
44 45
 
45 46
 
46 47
         if($this->Attributes()->has('value'))
47 48
         {
48
-            if(!is_array($this->Attributes()->get('value')))
49
-                $this->Attributes()->set('value',[$this->Attributes()->get('value')]);
49
+            if(!is_array($this->Attributes()->get('value'))) {
50
+                            $this->Attributes()->set('value',[$this->Attributes()->get('value')]);
51
+            }
52
+        } else {
53
+                    $this->Attributes()->set('value',[]);
50 54
         }
51
-        else
52
-            $this->Attributes()->set('value',[]);
53 55
 
54
-        if($this->Attributes()->has('multiple') AND $this->Attributes()->get('multiple')==='multiple')
55
-            $multiple=true;
56
+        if($this->Attributes()->has('multiple') AND $this->Attributes()->get('multiple')==='multiple') {
57
+                    $multiple=true;
58
+        }
56 59
 
57 60
         if($multiple)
58 61
         {   $this->Attributes()->set('size',$this->Attributes()->get('size',3));
59
-            if(substr($this->Attributes()->get('name'), -2) !== '[]')
60
-                $this->Attributes()->set('name',$this->Attributes()->get('name').'[]');
62
+            if(substr($this->Attributes()->get('name'), -2) !== '[]') {
63
+                            $this->Attributes()->set('name',$this->Attributes()->get('name').'[]');
64
+            }
61 65
         }
62 66
         $html .= $this->Label()->RenderHtml();
63 67
         $this->Attributes()->Ignore(['value','selected','optgroup-attributes','option-attributes','placeholder']);
64 68
 
65 69
         $html .= '<select'.$this->Attributes()->RenderHtml().'>';
66
-        if(empty($this->Attributes()->get('value')[0]) and $this->Attributes()->has('placeholder'))
67
-            $html .= '<option value="" disabled selected>'.$this->Attributes()->get('placeholder').'</option>';
70
+        if(empty($this->Attributes()->get('value')[0]) and $this->Attributes()->has('placeholder')) {
71
+                    $html .= '<option value="" disabled selected>'.$this->Attributes()->get('placeholder').'</option>';
72
+        }
68 73
 
69 74
         foreach($this->options as $index=>$datas):
70 75
 
71
-            if(is_array($datas))
72
-                $html .= $this->createOptgroup($index,$datas);
73
-            else
76
+            if(is_array($datas)) {
77
+                            $html .= $this->createOptgroup($index,$datas);
78
+            } else
74 79
             {
75 80
                 $optionAttr = null;
76 81
                 if($this->Attributes()->has('option-attributes'))
@@ -86,7 +91,9 @@  discard block
 block discarded – undo
86 91
                     $html .= ' selected="selected"';
87 92
                     $this->selected = true;
88 93
                 }
89
-                if($optionAttr) $html .= ' '.$optionAttr ;
94
+                if($optionAttr) {
95
+                  $html .= ' '.$optionAttr ;
96
+                }
90 97
                 $html .= '>';
91 98
                 $html .= $datas.'</option>';
92 99
             }
@@ -119,13 +126,15 @@  discard block
 block discarded – undo
119 126
             $optionAttr .= $oOption->RenderHtml();
120 127
         }
121 128
         $output='<optgroup label="'.$label.'"';
122
-        if($groupAttr) $output .= ' '.$groupAttr ;
129
+        if($groupAttr) {
130
+          $output .= ' '.$groupAttr ;
131
+        }
123 132
         $output .= '>';
124 133
         foreach($options as $key=>$optLabel)
125 134
         {
126
-            if(is_array($optLabel))
127
-                $output .= call_user_func_array([$this,__METHOD__],[$optLabel]);
128
-            else
135
+            if(is_array($optLabel)) {
136
+                            $output .= call_user_func_array([$this,__METHOD__],[$optLabel]);
137
+            } else
129 138
             {
130 139
                 $output .= '<option value="'.$key.'"';
131 140
                 if(!$this->selected and in_array($key,$this->Attributes()->get('value')))
@@ -133,7 +142,9 @@  discard block
 block discarded – undo
133 142
                     $output .= ' selected="selected"';
134 143
                     $this->selected = true;
135 144
                 }
136
-                if($optionAttr) $output .= ' '.$optionAttr ;
145
+                if($optionAttr) {
146
+                  $output .= ' '.$optionAttr ;
147
+                }
137 148
                 $output .= '>';
138 149
                 $output .= $optLabel.'</option>';
139 150
             }
Please login to merge, or discard this patch.
Elements/Textarea.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,9 @@
 block discarded – undo
26 26
      */
27 27
     public function RenderHtml(): string
28 28
     {
29
-        if (!$this->Attributes()->has('id'))
30
-            $this->Attributes()->createElementID($this->Attributes()->get('name', $this->label()->getItemID()));
29
+        if (!$this->Attributes()->has('id')) {
30
+                    $this->Attributes()->createElementID($this->Attributes()->get('name', $this->label()->getItemID()));
31
+        }
31 32
         $this->label()->Attribute()->set('fieldtype', $this->Attributes()->get('type'));
32 33
         $this->label()->Attribute()->set('for', $this->Attributes()->get('id'));
33 34
 
Please login to merge, or discard this patch.
FormGenerator.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -267,8 +267,9 @@  discard block
 block discarded – undo
267 267
     {
268 268
         if($this->Form instanceof form)
269 269
         {
270
-            if($this->Fieldset instanceof fieldsetGenerator)
271
-                $this->Form->append($this->Fieldset->Close());
270
+            if($this->Fieldset instanceof fieldsetGenerator) {
271
+                            $this->Form->append($this->Fieldset->Close());
272
+            }
272 273
             $this->Fieldset = new fieldsetGenerator($attributes);
273 274
             $this->Fieldset->Attributes()->set('name', $this->Form->Attributes()->get('name'));
274 275
             $this->Form->append($this->Fieldset->Open());
@@ -316,8 +317,9 @@  discard block
 block discarded – undo
316 317
     {
317 318
         if($this->Form instanceof form)
318 319
         {
319
-            if(gettype($html) === 'string')
320
-            $this->Form->append($html);
320
+            if(gettype($html) === 'string') {
321
+                        $this->Form->append($html);
322
+            }
321 323
         }
322 324
         return $this;
323 325
     }
@@ -617,12 +619,14 @@  discard block
 block discarded – undo
617 619
         $html = null;
618 620
         if ($this->Form instanceof form)
619 621
         {
620
-            if($this->Fieldset instanceof fieldsetGenerator)
621
-                $this->Form->append($this->Fieldset->Close());
622
+            if($this->Fieldset instanceof fieldsetGenerator) {
623
+                            $this->Form->append($this->Fieldset->Close());
624
+            }
622 625
             $html = $this->Form->RenderHtml();
623 626
             $this->Form = null;
624
-            if($print)
625
-                print_r($html);
627
+            if($print) {
628
+                            print_r($html);
629
+            }
626 630
         }
627 631
         return $html;
628 632
     }
@@ -653,8 +657,9 @@  discard block
 block discarded – undo
653 657
                 $Request = $this->Request->query; 
654 658
             break;
655 659
         }
656
-        if(!$value = $Request->get($name, $default))
657
-        $value = $element->Attributes()->get('value', $default);
660
+        if(!$value = $Request->get($name, $default)) {
661
+                $value = $element->Attributes()->get('value', $default);
662
+        }
658 663
         return $value;
659 664
     }
660 665
     /**
@@ -663,8 +668,9 @@  discard block
 block discarded – undo
663 668
      */
664 669
     public function Open($attributes = [])
665 670
     {
666
-        if($this->Form instanceof form)
667
-            $this->Close();
671
+        if($this->Form instanceof form) {
672
+                    $this->Close();
673
+        }
668 674
         $this->Form = new form($attributes);
669 675
         return $this;
670 676
     }
Please login to merge, or discard this patch.
Core/FieldsetGenerator.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,8 +25,9 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function __construct($attributes)
27 27
     {
28
-        if(!$attributes instanceof AttributesBuilder)
29
-            $attributes  = new AttributesBuilder($attributes);
28
+        if(!$attributes instanceof AttributesBuilder) {
29
+                    $attributes  = new AttributesBuilder($attributes);
30
+        }
30 31
         $this->attributes = $attributes;
31 32
         if($this->attributes->has('legend'))
32 33
         {
@@ -58,8 +59,9 @@  discard block
 block discarded – undo
58 59
         if($this->legend)
59 60
         {
60 61
             $html .= '<legend';
61
-            if($this->legendAttributes instanceof AttributesBuilder)
62
-            $html .= $this->legendAttributes->RenderHtml();
62
+            if($this->legendAttributes instanceof AttributesBuilder) {
63
+                        $html .= $this->legendAttributes->RenderHtml();
64
+            }
63 65
             $html .= '>';
64 66
             $html .= $this->legend;
65 67
             $html .= '</legend>';
@@ -74,8 +76,9 @@  discard block
 block discarded – undo
74 76
     public function Close()
75 77
     {
76 78
         $html  = '';
77
-        if($this->isOpened)
78
-            $html .= '</fieldset>';
79
+        if($this->isOpened) {
80
+                    $html .= '</fieldset>';
81
+        }
79 82
         return $html;
80 83
     }
81 84
 
Please login to merge, or discard this patch.
Core/Libs/LabelGenerator.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,9 @@
 block discarded – undo
27 27
     public function __construct(string $item, $attributes=[])
28 28
     {
29 29
         $this->item = $item;
30
-        if(!$attributes instanceof AttributesBuilder)
31
-            $attributes  = new AttributesBuilder($attributes);
30
+        if(!$attributes instanceof AttributesBuilder) {
31
+                    $attributes  = new AttributesBuilder($attributes);
32
+        }
32 33
         $this->attributes = $attributes;
33 34
         $this->attributes->set('type','label');
34 35
             return $this;
Please login to merge, or discard this patch.
Core/Libs/AttributesMapper.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@  discard block
 block discarded – undo
48 48
             case 'number':
49 49
             case 'time':
50 50
             case 'week':
51
-                if($Type === 'number') $AcceptedAttributes[]='placeholder';
51
+                if($Type === 'number') {
52
+                  $AcceptedAttributes[]='placeholder';
53
+                }
52 54
                 $AcceptedAttributes = array_merge($AcceptedAttributes,self::DATE);
53 55
                 break;
54 56
             case 'color':
@@ -67,7 +69,9 @@  discard block
 block discarded – undo
67 69
                 if($Type === 'radio')
68 70
                 {
69 71
                     $bannedIndex = array_search('indeterminate', $tmpAttributesList,true);
70
-                    if(isset($tmpAttributesList[$bannedIndex])) unset($tmpAttributesList[$bannedIndex]);
72
+                    if(isset($tmpAttributesList[$bannedIndex])) {
73
+                      unset($tmpAttributesList[$bannedIndex]);
74
+                    }
71 75
                 }
72 76
                 $AcceptedAttributes = array_merge($AcceptedAttributes,array_values($tmpAttributesList));
73 77
                 break;
@@ -109,7 +113,9 @@  discard block
 block discarded – undo
109 113
                 $AcceptedAttributes = array_merge($AcceptedAttributes,self::HIDDEN);
110 114
                 break;
111 115
             default:
112
-                if($Type === 'email') $AcceptedAttributes[]='multiple';
116
+                if($Type === 'email') {
117
+                  $AcceptedAttributes[]='multiple';
118
+                }
113 119
                 $AcceptedAttributes = array_merge($AcceptedAttributes,self::TEXT);
114 120
                 break;
115 121
         endswitch;
@@ -132,7 +138,9 @@  discard block
 block discarded – undo
132 138
                 continue;
133 139
             }
134 140
         }
135
-        if($ignore) $Attributes->Ignore($ignore);
141
+        if($ignore) {
142
+          $Attributes->Ignore($ignore);
143
+        }
136 144
         return $ignore;
137 145
     }
138 146
 }
139 147
\ No newline at end of file
Please login to merge, or discard this patch.