Completed
Pull Request — master (#588)
by
unknown
14:32
created
xoops_lib/Xoops/Html/Attributes.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
     public function add($name, $value)
51 51
     {
52 52
         if (is_scalar($value)) {
53
-            $value = explode(' ', (string) $value);
53
+            $value = explode(' ', (string)$value);
54 54
         }
55 55
         $values = $this->get($name, []);
56 56
         if (is_scalar($values)) {
57
-            $values = (array) $values;
57
+            $values = (array)$values;
58 58
         }
59 59
         foreach ($value as $v) {
60 60
             if (!in_array($v, $values)) {
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function suppressRender($names)
80 80
     {
81
-        $names = (array) $names;
81
+        $names = (array)$names;
82 82
         $this->suppressRenderAttributes = array_unique(
83 83
             array_merge($this->suppressRenderAttributes, $names)
84 84
         );
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
             }
127 127
             if (is_array($value)) {
128 128
                 // arrays can be used for class attributes, space separated
129
-                $set = '="' . htmlspecialchars(implode(' ', $value), ENT_QUOTES) .'"';
130
-            } elseif ($value===null) {
129
+                $set = '="'.htmlspecialchars(implode(' ', $value), ENT_QUOTES).'"';
130
+            } elseif ($value === null) {
131 131
                 // null indicates attribute minimization (name only,) like autofocus or readonly
132 132
                 $set = '';
133 133
             } else {
134
-                $set = '="' . htmlspecialchars($value, ENT_QUOTES) .'"';
134
+                $set = '="'.htmlspecialchars($value, ENT_QUOTES).'"';
135 135
             }
136
-            $rendered .= htmlspecialchars($name, ENT_QUOTES) . $set . ' ';
136
+            $rendered .= htmlspecialchars($name, ENT_QUOTES).$set.' ';
137 137
         }
138 138
         return $rendered;
139 139
     }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     public function getNames()
235 235
     {
236
-        return array_keys((array) $this);
236
+        return array_keys((array)$this);
237 237
     }
238 238
 
239 239
     /**
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 
310 310
         $likeSet = array();
311 311
         foreach ($this as $k => $v) {
312
-            if (substr($k, 0, strlen($nameLike))==$nameLike) {
313
-                $likeSet[$k]=$v;
312
+            if (substr($k, 0, strlen($nameLike)) == $nameLike) {
313
+                $likeSet[$k] = $v;
314 314
             }
315 315
         }
316 316
         return $likeSet;
Please login to merge, or discard this patch.
xoops_lib/Xoops/Core/Theme/XoopsTheme.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
      */
175 175
     public $headersCacheEngine = 'default';
176 176
 	
177
-	/**
177
+    /**
178 178
      * 
179 179
      *$renderer instance of renderer
180 180
      * 
181 181
      */	
182
-	protected $renderer;
182
+    protected $renderer;
183 183
 
184 184
     /**
185 185
      * *#@-
@@ -321,10 +321,10 @@  discard block
 block discarded – undo
321 321
      */
322 322
     public function setRenderer($renderer)
323 323
     {
324
-		$this->renderer = $renderer;
324
+        $this->renderer = $renderer;
325 325
     }
326 326
 	
327
-	/**
327
+    /**
328 328
      * get the renderer
329 329
      *
330 330
      * @return Renderer
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
     {
334 334
         // return a default if not set
335 335
         if (null === $this->renderer) {
336
-			return $element->defaultRender();
337
-		} else {
338
-			return $this->renderer->render($element);
339
-		}
336
+            return $element->defaultRender();
337
+        } else {
338
+            return $this->renderer->render($element);
339
+        }
340 340
     }
341 341
 
342 342
     /**
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/Text.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public function getSize()
59 59
     {
60
-        return (int) $this->get('size');
60
+        return (int)$this->get('size');
61 61
     }
62 62
 
63 63
     /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function getMaxlength()
69 69
     {
70
-        return (int) $this->get('maxlength');
70
+        return (int)$this->get('maxlength');
71 71
     }
72 72
 
73 73
     /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function getPlaceholder()
79 79
     {
80
-        return (string) $this->get('placeholder');
80
+        return (string)$this->get('placeholder');
81 81
     }
82 82
 
83 83
     /**
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
     {
90 90
         $dataList = $this->isDatalist();
91 91
         if (!empty($dataList)) {
92
-            $this->add('list', 'list_' . $this->getName());
92
+            $this->add('list', 'list_'.$this->getName());
93 93
         }
94 94
 
95 95
         $attributes = $this->renderAttributeString();
96
-        return '<input ' . $attributes . ' ' . $this->getExtra() .' >';
96
+        return '<input '.$attributes.' '.$this->getExtra().' >';
97 97
     }
98 98
 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/Select.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public function getSize()
75 75
     {
76
-        return (int) $this->get('size');
76
+        return (int)$this->get('size');
77 77
     }
78 78
 
79 79
      /**
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public function renderOption($optionValue, $optionDisplay, $selected)
102 102
     {
103
-        $rendered = '<option value="' . htmlspecialchars($optionValue, ENT_QUOTES) . '"';
103
+        $rendered = '<option value="'.htmlspecialchars($optionValue, ENT_QUOTES).'"';
104 104
         if (in_array($optionValue, $selected)) {
105 105
             $rendered .= ' selected="selected"';
106 106
         }
107
-        $rendered .= '>' . $optionDisplay . '</option>' . "\n";
107
+        $rendered .= '>'.$optionDisplay.'</option>'."\n";
108 108
 
109 109
         return $rendered;
110 110
     }
@@ -116,18 +116,18 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function defaultRender()
118 118
     {
119
-        $selected = (array) $this->getValue();
119
+        $selected = (array)$this->getValue();
120 120
 
121 121
         $ele_options = $this->getOptions();
122 122
 
123
-        $extra = ($this->getExtra() != '' ? " " . $this->getExtra() : '');
123
+        $extra = ($this->getExtra() != '' ? " ".$this->getExtra() : '');
124 124
         $attributes = $this->renderAttributeString();
125
-        $rendered = '<select ' . $attributes . $extra .' >' . "\n";
125
+        $rendered = '<select '.$attributes.$extra.' >'."\n";
126 126
 
127 127
         if (empty($ele_optgroup)) {
128 128
             foreach ($ele_options as $value => $display) {
129 129
                 if (is_array($display)) {
130
-                    $rendered .= '<optgroup label="' . $value . '">' . "\n";
130
+                    $rendered .= '<optgroup label="'.$value.'">'."\n";
131 131
                     foreach ($display as $optvalue => $optdisplay) {
132 132
                         $rendered .= $this->renderOption($optvalue, $optdisplay, $selected);
133 133
                     }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                 }
137 137
             }
138 138
         }
139
-        $rendered .= '</select>' . "\n";
139
+        $rendered .= '</select>'."\n";
140 140
 
141 141
         return $rendered;
142 142
     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             return "\nvar hasSelected = false; var selectBox = myform.{$eltname};"
163 163
                 . "for (i = 0; i < selectBox.options.length; i++ ) { "
164 164
                 . "if (selectBox.options[i].selected == true && selectBox.options[i].value != '') "
165
-                . "{ hasSelected = true; break; } }" . "if (!hasSelected) "
165
+                . "{ hasSelected = true; break; } }"."if (!hasSelected) "
166 166
                 . "{ window.alert(\"{$eltmsg}\"); selectBox.focus(); return false; }";
167 167
         }
168 168
         return '';
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/ColorPicker.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     {
37 37
         if (is_array($caption)) {
38 38
             parent::__construct($caption);
39
-            $value = $this->get('value','');
39
+            $value = $this->get('value', '');
40 40
             if (empty($value)) {
41 41
                 $this->set('value', '#FFFFFF');
42 42
             }
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
         if ($xoops->theme()) {
65 65
             $xoops->theme()->addScript('include/color-picker.js');
66 66
         } else {
67
-            echo '<script type="text/javascript" src="' . $xoops->url('/include/color-picker.js') . '"></script>';
67
+            echo '<script type="text/javascript" src="'.$xoops->url('/include/color-picker.js').'"></script>';
68 68
         }
69 69
         $temp = $this->get('value', '');
70 70
         if (!empty($temp)) {
71
-            $this->set('style', 'background-color:' . $temp . ';');
71
+            $this->set('style', 'background-color:'.$temp.';');
72 72
         }
73 73
         $ret = '<div>';
74 74
         $attributes = $this->renderAttributeString();
75
-        $ret .= '<input ' . $attributes . ' ' . $this->getExtra() .' >';
75
+        $ret .= '<input '.$attributes.' '.$this->getExtra().' >';
76 76
         $ret .= '<span>';
77 77
         $ret .= '<button type="button" ';
78
-        $ret .= 'data-toggle="tooltip" data-placement="left" title="' . \XoopsLocale::A_SELECT . '" ';
78
+        $ret .= 'data-toggle="tooltip" data-placement="left" title="'.\XoopsLocale::A_SELECT.'" ';
79 79
         $ret .= 'onclick="return TCP.popup(\'';
80
-        $ret .= $xoops->url('/include/') . '\',document.getElementById(\'' . $this->getName() . '\'));">';
80
+        $ret .= $xoops->url('/include/').'\',document.getElementById(\''.$this->getName().'\'));">';
81 81
         $ret .= '<span>...</span></button>';
82 82
         $ret .= '</span></div>';
83 83
 
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/ButtonTray.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function getType()
60 60
     {
61
-        return (string) $this->get('type', '');
61
+        return (string)$this->get('type', '');
62 62
     }
63 63
 
64 64
     /**
@@ -69,18 +69,18 @@  discard block
 block discarded – undo
69 69
     public function defaultRender()
70 70
     {
71 71
         $ret = '';
72
-        $class = 'class="' . $this->getClass() . '"';
72
+        $class = 'class="'.$this->getClass().'"';
73 73
 
74 74
         $attributes = $this->renderAttributeString();
75 75
 
76
-        if ((bool) $this->get(':showdelete', false)) {
77
-            $ret .= '<input type="submit"' . $class . ' name="delete" id="delete" value="'
78
-                . \XoopsLocale::A_DELETE . '" onclick="this.form.elements.op.value=\'delete\'">';
76
+        if ((bool)$this->get(':showdelete', false)) {
77
+            $ret .= '<input type="submit"'.$class.' name="delete" id="delete" value="'
78
+                . \XoopsLocale::A_DELETE.'" onclick="this.form.elements.op.value=\'delete\'">';
79 79
         }
80
-        $ret .= ' <input type="button" ' . $class . ' value="' . \XoopsLocale::A_CANCEL
80
+        $ret .= ' <input type="button" '.$class.' value="'.\XoopsLocale::A_CANCEL
81 81
             . '" onclick="history.go(-1);return true;" />'
82
-            . ' <input type="reset"' . $class . ' name="reset"  id="reset" value="' . \XoopsLocale::A_RESET . '" />'
83
-            . ' <input ' . $attributes . $this->getExtra() . ' />';
82
+            . ' <input type="reset"'.$class.' name="reset"  id="reset" value="'.\XoopsLocale::A_RESET.'" />'
83
+            . ' <input '.$attributes.$this->getExtra().' />';
84 84
         return $ret;
85 85
     }
86 86
 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/Password.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
             parent::__construct([]);
54 54
             $this->setCaption($caption);
55 55
             $this->setWithDefaults('name', $name, 'name_error');
56
-            $this->set('size', empty($size) ? 32 : (int) $size);
57
-            $this->set('maxlength', empty($maxlength) ? 64 : (int) $maxlength);
56
+            $this->set('size', empty($size) ? 32 : (int)$size);
57
+            $this->set('maxlength', empty($maxlength) ? 64 : (int)$maxlength);
58 58
             $this->setValue($value);
59 59
             $this->setWithDefaults('autocomplete', $autoComplete, 'off', ['on', 'off']);
60 60
             if (!empty($placeholder)) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function getSize()
73 73
     {
74
-        return (int) $this->get('size', 32);
74
+        return (int)$this->get('size', 32);
75 75
     }
76 76
 
77 77
     /**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function getMaxlength()
83 83
     {
84
-        return (int) $this->get('maxlength', 64);
84
+        return (int)$this->get('maxlength', 64);
85 85
     }
86 86
 
87 87
     /**
@@ -92,6 +92,6 @@  discard block
 block discarded – undo
92 92
     public function defaultRender()
93 93
     {
94 94
         $attributes = $this->renderAttributeString();
95
-        return '<input ' . $attributes . $this->getExtra() .' >';
95
+        return '<input '.$attributes.$this->getExtra().' >';
96 96
     }
97 97
 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/Button.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,6 +53,6 @@
 block discarded – undo
53 53
     public function defaultRender()
54 54
     {
55 55
         $attributes = $this->renderAttributeString();
56
-        return '<input ' . $attributes . $this->getExtra() .' >';
56
+        return '<input '.$attributes.$this->getExtra().' >';
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
xoops_lib/Xoops/Form/DateSelect.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         $dataList = $this->isDatalist();
61 61
         if (!empty($dataList)) {
62
-            $this->add('list', 'list_' . $this->getName());
62
+            $this->add('list', 'list_'.$this->getName());
63 63
         }
64 64
 
65 65
         $this->suppressRender(['value']);
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
         $xoops->theme()->addScript(
73 73
             '',
74 74
             '',
75
-            ' $(function() { $( "#' . $this->get('id') . '" ).datepicker({' .
76
-            'showOn: "focus", changeYear: true, constrainInput: false ' .
75
+            ' $(function() { $( "#'.$this->get('id').'" ).datepicker({'.
76
+            'showOn: "focus", changeYear: true, constrainInput: false '.
77 77
             ' }); }); '
78 78
         );
79 79
         $ret = '<div>';
80
-        $ret .= '<input ' . $attributes . ' value="' . $display_value . '" ' . $this->getExtra() .' >';
80
+        $ret .= '<input '.$attributes.' value="'.$display_value.'" '.$this->getExtra().' >';
81 81
         $ret .= '<span>';
82 82
         $ret .= '<button type="button" ';
83
-        $ret .= 'data-toggle="tooltip" data-placement="left" title="' . \XoopsLocale::A_SELECT . '" ';
84
-        $ret .= 'onclick="$( \'#' . $this->get('id') . '\' ).datepicker( \'show\' );"> ';
83
+        $ret .= 'data-toggle="tooltip" data-placement="left" title="'.\XoopsLocale::A_SELECT.'" ';
84
+        $ret .= 'onclick="$( \'#'.$this->get('id').'\' ).datepicker( \'show\' );"> ';
85 85
         $ret .= '<span>...</span></button>';
86 86
         $ret .= '</span></div>';
87 87
 
Please login to merge, or discard this patch.