@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function setOption(string $name, $value) |
43 | 43 | { |
44 | - if(!isset($this->options)) { |
|
44 | + if (!isset($this->options)) { |
|
45 | 45 | $this->options = $this->getDefaultOptions(); |
46 | 46 | } |
47 | 47 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function setOptions(array $options) |
60 | 60 | { |
61 | - foreach($options as $name => $value) { |
|
61 | + foreach ($options as $name => $value) { |
|
62 | 62 | $this->setOption($name, $value); |
63 | 63 | } |
64 | 64 | |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | * @param mixed $default The default value to return if the option does not exist. |
76 | 76 | * @return mixed |
77 | 77 | */ |
78 | - public function getOption(string $name, $default=null) |
|
78 | + public function getOption(string $name, $default = null) |
|
79 | 79 | { |
80 | - if(!isset($this->options)) { |
|
80 | + if (!isset($this->options)) { |
|
81 | 81 | $this->options = $this->getDefaultOptions(); |
82 | 82 | } |
83 | 83 | |
84 | - if(isset($this->options[$name])) { |
|
84 | + if (isset($this->options[$name])) { |
|
85 | 85 | return $this->options[$name]; |
86 | 86 | } |
87 | 87 | |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | * @param string $default Used if the option does not exist, is invalid, or empty. |
99 | 99 | * @return string |
100 | 100 | */ |
101 | - public function getStringOption(string $name, string $default='') : string |
|
101 | + public function getStringOption(string $name, string $default = '') : string |
|
102 | 102 | { |
103 | 103 | $value = $this->getOption($name, false); |
104 | 104 | |
105 | - if((is_string($value) || is_numeric($value)) && !empty($value)) { |
|
105 | + if ((is_string($value) || is_numeric($value)) && !empty($value)) { |
|
106 | 106 | return (string)$value; |
107 | 107 | } |
108 | 108 | |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | * @param bool $default |
120 | 120 | * @return bool |
121 | 121 | */ |
122 | - public function getBoolOption(string $name, bool $default=false) : bool |
|
122 | + public function getBoolOption(string $name, bool $default = false) : bool |
|
123 | 123 | { |
124 | - if($this->getOption($name) === true) { |
|
124 | + if ($this->getOption($name) === true) { |
|
125 | 125 | return true; |
126 | 126 | } |
127 | 127 | |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | * @param int $default |
138 | 138 | * @return int |
139 | 139 | */ |
140 | - public function getIntOption(string $name, int $default=0) : int |
|
140 | + public function getIntOption(string $name, int $default = 0) : int |
|
141 | 141 | { |
142 | 142 | $value = $this->getOption($name); |
143 | - if(ConvertHelper::isInteger($value)) { |
|
143 | + if (ConvertHelper::isInteger($value)) { |
|
144 | 144 | return (int)$value; |
145 | 145 | } |
146 | 146 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | public function getArrayOption(string $name) : array |
159 | 159 | { |
160 | 160 | $val = $this->getOption($name); |
161 | - if(is_array($val)) { |
|
161 | + if (is_array($val)) { |
|
162 | 162 | return $val; |
163 | 163 | } |
164 | 164 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function hasOption(string $name) : bool |
176 | 176 | { |
177 | - if(!isset($this->options)) { |
|
177 | + if (!isset($this->options)) { |
|
178 | 178 | $this->options = $this->getDefaultOptions(); |
179 | 179 | } |
180 | 180 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function getOptions() : array |
190 | 190 | { |
191 | - if(!isset($this->options)) { |
|
191 | + if (!isset($this->options)) { |
|
192 | 192 | $this->options = $this->getDefaultOptions(); |
193 | 193 | } |
194 | 194 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | $string = strval($string); |
70 | 70 | |
71 | - if(!empty($string)) |
|
71 | + if (!empty($string)) |
|
72 | 72 | { |
73 | 73 | $this->strings[] = $string; |
74 | 74 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | { |
148 | 148 | array_unshift($arguments, $format); |
149 | 149 | |
150 | - if(!class_exists('\AppLocalize\Localization')) |
|
150 | + if (!class_exists('\AppLocalize\Localization')) |
|
151 | 151 | { |
152 | 152 | return $this->sf(...$arguments); |
153 | 153 | } |
@@ -293,9 +293,9 @@ discard block |
||
293 | 293 | * @param StringBuilder_Interface|string|NULL $content |
294 | 294 | * @return $this |
295 | 295 | */ |
296 | - public function para($content=null) : StringBuilder |
|
296 | + public function para($content = null) : StringBuilder |
|
297 | 297 | { |
298 | - if($content !== null) { |
|
298 | + if ($content !== null) { |
|
299 | 299 | return $this->html('<p>')->nospace($content)->html('</p>'); |
300 | 300 | } |
301 | 301 | |
@@ -310,10 +310,10 @@ discard block |
||
310 | 310 | * @param bool $newTab |
311 | 311 | * @return $this |
312 | 312 | */ |
313 | - public function link(string $label, string $url, bool $newTab=false) : StringBuilder |
|
313 | + public function link(string $label, string $url, bool $newTab = false) : StringBuilder |
|
314 | 314 | { |
315 | 315 | $target = ''; |
316 | - if($newTab) { |
|
316 | + if ($newTab) { |
|
317 | 317 | $target = ' target="_blank"'; |
318 | 318 | } |
319 | 319 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | */ |
360 | 360 | public function spanned($string, $classes) : StringBuilder |
361 | 361 | { |
362 | - if(!is_array($classes)) |
|
362 | + if (!is_array($classes)) |
|
363 | 363 | { |
364 | 364 | $classes = array(strval($classes)); |
365 | 365 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | * @param mixed $default The default value to return if the option does not exist. |
46 | 46 | * @return mixed |
47 | 47 | */ |
48 | - function getOption(string $name, $default=null); |
|
48 | + function getOption(string $name, $default = null); |
|
49 | 49 | |
50 | 50 | /** |
51 | 51 | * Sets a collection of options at once, from an |