@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | * @param bool $caseInsensitive |
20 | 20 | * @return ConvertHelper_StringMatch[] |
21 | 21 | */ |
22 | - public static function findString(string $needle, string $haystack, bool $caseInsensitive=false): array |
|
22 | + public static function findString(string $needle, string $haystack, bool $caseInsensitive = false): array |
|
23 | 23 | { |
24 | - if($needle === '') { |
|
24 | + if ($needle === '') { |
|
25 | 25 | return array(); |
26 | 26 | } |
27 | 27 | |
28 | 28 | $function = 'mb_strpos'; |
29 | - if($caseInsensitive) { |
|
29 | + if ($caseInsensitive) { |
|
30 | 30 | $function = 'mb_stripos'; |
31 | 31 | } |
32 | 32 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $positions = array(); |
35 | 35 | $length = mb_strlen($needle); |
36 | 36 | |
37 | - while( ($pos = $function($haystack, $needle, $pos)) !== false) |
|
37 | + while (($pos = $function($haystack, $needle, $pos)) !== false) |
|
38 | 38 | { |
39 | 39 | $match = mb_substr($haystack, $pos, $length); |
40 | 40 | $positions[] = new ConvertHelper_StringMatch($pos, $match); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public static function toArray(string $string) : array |
58 | 58 | { |
59 | 59 | $result = preg_split('//u', $string, 0, PREG_SPLIT_NO_EMPTY); |
60 | - if($result !== false) { |
|
60 | + if ($result !== false) { |
|
61 | 61 | return $result; |
62 | 62 | } |
63 | 63 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public static function toUtf8(string $string) : string |
112 | 112 | { |
113 | - if(!self::isASCII($string)) { |
|
113 | + if (!self::isASCII($string)) { |
|
114 | 114 | return Encoding::toUTF8($string); |
115 | 115 | } |
116 | 116 | |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public static function isASCII(string $string) : bool |
130 | 130 | { |
131 | - if($string === '' || $string === NULL) { |
|
131 | + if ($string === '' || $string === NULL) { |
|
132 | 132 | return true; |
133 | 133 | } |
134 | 134 | |
135 | - if(!is_string($string)) { |
|
135 | + if (!is_string($string)) { |
|
136 | 136 | return false; |
137 | 137 | } |
138 | 138 | |
@@ -147,12 +147,12 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public static function isHTML(string $string) : bool |
149 | 149 | { |
150 | - if(preg_match('%<[a-z/][\s\S]*>%siU', $string)) { |
|
150 | + if (preg_match('%<[a-z/][\s\S]*>%siU', $string)) { |
|
151 | 151 | return true; |
152 | 152 | } |
153 | 153 | |
154 | 154 | $decoded = html_entity_decode($string); |
155 | - if($decoded !== $string) { |
|
155 | + if ($decoded !== $string) { |
|
156 | 156 | return true; |
157 | 157 | } |
158 | 158 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * @param int $tabSize The amount of spaces per tab. |
185 | 185 | * @return string |
186 | 186 | */ |
187 | - public static function tabs2spaces(string $string, int $tabSize=4) : string |
|
187 | + public static function tabs2spaces(string $string, int $tabSize = 4) : string |
|
188 | 188 | { |
189 | 189 | return str_replace("\t", str_repeat(' ', $tabSize), $string); |
190 | 190 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * @param int $tabSize The amount of spaces per tab in the source string. |
197 | 197 | * @return string |
198 | 198 | */ |
199 | - public static function spaces2tabs(string $string, int $tabSize=4) : string |
|
199 | + public static function spaces2tabs(string $string, int $tabSize = 4) : string |
|
200 | 200 | { |
201 | 201 | return str_replace(str_repeat(' ', $tabSize), "\t", $string); |
202 | 202 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | return $text; |
274 | 274 | } |
275 | 275 | |
276 | - $text = trim(mb_substr($text, 0, $targetLength)) . $append; |
|
276 | + $text = trim(mb_substr($text, 0, $targetLength)).$append; |
|
277 | 277 | |
278 | 278 | return $text; |
279 | 279 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | public static function explodeTrim(string $delimiter, string $string) : array |
290 | 290 | { |
291 | - if(empty($string) || empty($delimiter)) { |
|
291 | + if (empty($string) || empty($delimiter)) { |
|
292 | 292 | return array(); |
293 | 293 | } |
294 | 294 | |
@@ -296,8 +296,8 @@ discard block |
||
296 | 296 | $tokens = array_map('trim', $tokens); |
297 | 297 | |
298 | 298 | $keep = array(); |
299 | - foreach($tokens as $token) { |
|
300 | - if($token !== '') { |
|
299 | + foreach ($tokens as $token) { |
|
300 | + if ($token !== '') { |
|
301 | 301 | $keep[] = $token; |
302 | 302 | } |
303 | 303 | } |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public static function detect(string $subjectString) : ?ConvertHelper_EOL |
120 | 120 | { |
121 | - if(empty($subjectString)) { |
|
121 | + if (empty($subjectString)) { |
|
122 | 122 | return null; |
123 | 123 | } |
124 | 124 | |
125 | - if(!isset(self::$eolChars)) |
|
125 | + if (!isset(self::$eolChars)) |
|
126 | 126 | { |
127 | 127 | $cr = chr((int)hexdec('0d')); |
128 | 128 | $lf = chr((int)hexdec('0a')); |
@@ -153,18 +153,18 @@ discard block |
||
153 | 153 | |
154 | 154 | $max = 0; |
155 | 155 | $results = array(); |
156 | - foreach(self::$eolChars as $def) |
|
156 | + foreach (self::$eolChars as $def) |
|
157 | 157 | { |
158 | 158 | $amount = substr_count($subjectString, $def['char']); |
159 | 159 | |
160 | - if($amount > $max) |
|
160 | + if ($amount > $max) |
|
161 | 161 | { |
162 | 162 | $max = $amount; |
163 | 163 | $results[] = $def; |
164 | 164 | } |
165 | 165 | } |
166 | 166 | |
167 | - if(empty($results)) { |
|
167 | + if (empty($results)) { |
|
168 | 168 | return null; |
169 | 169 | } |
170 | 170 |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public static function removeKeys(array &$sourceArray, array $keys) : void |
17 | 17 | { |
18 | - foreach($keys as $key) |
|
18 | + foreach ($keys as $key) |
|
19 | 19 | { |
20 | - if(array_key_exists($key, $sourceArray)) { |
|
20 | + if (array_key_exists($key, $sourceArray)) { |
|
21 | 21 | unset($sourceArray[$key]); |
22 | 22 | } |
23 | 23 | } |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | * @param bool $keepKeys Whether to maintain index association |
31 | 31 | * @return array |
32 | 32 | */ |
33 | - public static function removeValues(array $sourceArray, array $values, bool $keepKeys=false) : array |
|
33 | + public static function removeValues(array $sourceArray, array $values, bool $keepKeys = false) : array |
|
34 | 34 | { |
35 | 35 | $result = array(); |
36 | 36 | $values = array_values($values); |
37 | 37 | |
38 | - foreach($sourceArray as $key => $value) |
|
38 | + foreach ($sourceArray as $key => $value) |
|
39 | 39 | { |
40 | - if(in_array($value, $values, true)) { |
|
40 | + if (in_array($value, $values, true)) { |
|
41 | 41 | continue; |
42 | 42 | } |
43 | 43 | |
44 | - if($keepKeys) { |
|
44 | + if ($keepKeys) { |
|
45 | 45 | $result[$key] = $value; |
46 | 46 | continue; |
47 | 47 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public static function toStyleString(array $subject) : string |
75 | 75 | { |
76 | 76 | $tokens = array(); |
77 | - foreach($subject as $name => $value) { |
|
77 | + foreach ($subject as $name => $value) { |
|
78 | 78 | $tokens[] = $name.':'.strval($value); |
79 | 79 | } |
80 | 80 | |
@@ -103,18 +103,18 @@ discard block |
||
103 | 103 | public static function toAttributeString(array $array) : string |
104 | 104 | { |
105 | 105 | $tokens = array(); |
106 | - foreach($array as $attr => $value) |
|
106 | + foreach ($array as $attr => $value) |
|
107 | 107 | { |
108 | 108 | $value = strval($value); |
109 | 109 | |
110 | - if($value === '') { |
|
110 | + if ($value === '') { |
|
111 | 111 | continue; |
112 | 112 | } |
113 | 113 | |
114 | 114 | $tokens[] = $attr.'="'.htmlspecialchars($value, ENT_QUOTES, 'UTF-8').'"'; |
115 | 115 | } |
116 | 116 | |
117 | - if(empty($tokens)) { |
|
117 | + if (empty($tokens)) { |
|
118 | 118 | return ''; |
119 | 119 | } |
120 | 120 | |
@@ -135,17 +135,17 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public static function implodeWithAnd(array $list, string $sep = ', ', string $conjunction = '') : string |
137 | 137 | { |
138 | - if(empty($list)) { |
|
138 | + if (empty($list)) { |
|
139 | 139 | return ''; |
140 | 140 | } |
141 | 141 | |
142 | - if(empty($conjunction)) { |
|
142 | + if (empty($conjunction)) { |
|
143 | 143 | $conjunction = ' '.t('and').' '; |
144 | 144 | } |
145 | 145 | |
146 | 146 | $last = array_pop($list); |
147 | - if($list) { |
|
148 | - return implode($sep, $list) . $conjunction . $last; |
|
147 | + if ($list) { |
|
148 | + return implode($sep, $list).$conjunction.$last; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | return $last; |
@@ -29,17 +29,17 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public static function fromString($string) : bool |
31 | 31 | { |
32 | - if($string === '' || $string === null || !is_scalar($string)) |
|
32 | + if ($string === '' || $string === null || !is_scalar($string)) |
|
33 | 33 | { |
34 | 34 | return false; |
35 | 35 | } |
36 | 36 | |
37 | - if(is_bool($string)) |
|
37 | + if (is_bool($string)) |
|
38 | 38 | { |
39 | 39 | return $string; |
40 | 40 | } |
41 | 41 | |
42 | - if(array_key_exists($string, self::$booleanStrings)) |
|
42 | + if (array_key_exists($string, self::$booleanStrings)) |
|
43 | 43 | { |
44 | 44 | return self::$booleanStrings[$string]; |
45 | 45 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | public static function toString($boolean, bool $yesno = false) : string |
68 | 68 | { |
69 | 69 | // allow 'yes', 'true', 'no', 'false' string notations as well |
70 | - if(!is_bool($boolean)) { |
|
70 | + if (!is_bool($boolean)) { |
|
71 | 71 | $boolean = self::fromString($boolean); |
72 | 72 | } |
73 | 73 | |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public static function isBoolean($value) : bool |
99 | 99 | { |
100 | - if(is_bool($value)) { |
|
100 | + if (is_bool($value)) { |
|
101 | 101 | return true; |
102 | 102 | } |
103 | 103 | |
104 | - if(!is_scalar($value)) { |
|
104 | + if (!is_scalar($value)) { |
|
105 | 105 | return false; |
106 | 106 | } |
107 | 107 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param int $tabSize The amount of spaces per tab. |
50 | 50 | * @return string |
51 | 51 | */ |
52 | - public static function tabs2spaces(string $string, int $tabSize=4) : string |
|
52 | + public static function tabs2spaces(string $string, int $tabSize = 4) : string |
|
53 | 53 | { |
54 | 54 | return ConvertHelper_String::tabs2spaces($string, $tabSize); |
55 | 55 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * @param int $tabSize The amount of spaces per tab in the source string. |
62 | 62 | * @return string |
63 | 63 | */ |
64 | - public static function spaces2tabs(string $string, int $tabSize=4) : string |
|
64 | + public static function spaces2tabs(string $string, int $tabSize = 4) : string |
|
65 | 65 | { |
66 | 66 | return ConvertHelper_String::spaces2tabs($string, $tabSize); |
67 | 67 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | { |
109 | 109 | $converter = new ConvertHelper_DurationConverter(); |
110 | 110 | |
111 | - if($datefrom instanceof DateTime) |
|
111 | + if ($datefrom instanceof DateTime) |
|
112 | 112 | { |
113 | 113 | $converter->setDateFrom($datefrom); |
114 | 114 | } |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | $converter->setDateFrom(self::timestamp2date($datefrom)); |
118 | 118 | } |
119 | 119 | |
120 | - if($dateto instanceof DateTime) |
|
120 | + if ($dateto instanceof DateTime) |
|
121 | 121 | { |
122 | 122 | $converter->setDateTo($dateto); |
123 | 123 | } |
124 | - else if($dateto > 0) |
|
124 | + else if ($dateto > 0) |
|
125 | 125 | { |
126 | 126 | $converter->setDateTo(self::timestamp2date($dateto)); |
127 | 127 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @deprecated Use the Highlighter class directly instead. |
152 | 152 | * @see Highlighter::xml() |
153 | 153 | */ |
154 | - public static function highlight_xml(string $xml, bool $formatSource=false) : string |
|
154 | + public static function highlight_xml(string $xml, bool $formatSource = false) : string |
|
155 | 155 | { |
156 | 156 | return Highlighter::xml($xml, $formatSource); |
157 | 157 | } |
@@ -210,11 +210,11 @@ discard block |
||
210 | 210 | return ConvertHelper_String::cutText($text, $targetLength, $append); |
211 | 211 | } |
212 | 212 | |
213 | - public static function var_dump($var, $html=true) : string |
|
213 | + public static function var_dump($var, $html = true) : string |
|
214 | 214 | { |
215 | 215 | $info = parseVariable($var); |
216 | 216 | |
217 | - if($html) { |
|
217 | + if ($html) { |
|
218 | 218 | return $info->toHTML(); |
219 | 219 | } |
220 | 220 | |
@@ -229,11 +229,11 @@ discard block |
||
229 | 229 | * @param bool $html Whether to style the dump as HTML. |
230 | 230 | * @return string |
231 | 231 | */ |
232 | - public static function print_r($var, bool $return=false, bool $html=true) : string |
|
232 | + public static function print_r($var, bool $return = false, bool $html = true) : string |
|
233 | 233 | { |
234 | 234 | $result = parseVariable($var)->enableType()->toString(); |
235 | 235 | |
236 | - if($html) |
|
236 | + if ($html) |
|
237 | 237 | { |
238 | 238 | $result = |
239 | 239 | '<pre style="background:#fff;color:#333;padding:16px;border:solid 1px #bbb;border-radius:4px">'. |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | '</pre>'; |
242 | 242 | } |
243 | 243 | |
244 | - if(!$return) |
|
244 | + if (!$return) |
|
245 | 245 | { |
246 | 246 | echo $result; |
247 | 247 | } |
@@ -303,10 +303,10 @@ discard block |
||
303 | 303 | public static function date2listLabel(DateTime $date, $includeTime = false, $shortMonth = false) |
304 | 304 | { |
305 | 305 | $today = new DateTime(); |
306 | - if($date->format('d.m.Y') == $today->format('d.m.Y')) { |
|
306 | + if ($date->format('d.m.Y') == $today->format('d.m.Y')) { |
|
307 | 307 | $label = t('Today'); |
308 | 308 | } else { |
309 | - $label = $date->format('d') . '. ' . self::month2string((int)$date->format('m'), $shortMonth) . ' '; |
|
309 | + $label = $date->format('d').'. '.self::month2string((int)$date->format('m'), $shortMonth).' '; |
|
310 | 310 | if ($date->format('Y') != date('Y')) { |
311 | 311 | $label .= $date->format('Y'); |
312 | 312 | } |
@@ -461,12 +461,12 @@ discard block |
||
461 | 461 | $output = ''; |
462 | 462 | $split = str_split($unicodeChar); |
463 | 463 | |
464 | - foreach($split as $octet) |
|
464 | + foreach ($split as $octet) |
|
465 | 465 | { |
466 | 466 | $ordInt = ord($octet); |
467 | 467 | // Convert from int (base 10) to hex (base 16), for PHP \x syntax |
468 | 468 | $ordHex = base_convert((string)$ordInt, 10, 16); |
469 | - $output .= '\x' . $ordHex; |
|
469 | + $output .= '\x'.$ordHex; |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | return $output; |
@@ -499,19 +499,19 @@ discard block |
||
499 | 499 | |
500 | 500 | protected static function convertScalarForComparison($scalar) |
501 | 501 | { |
502 | - if($scalar === '' || is_null($scalar)) { |
|
502 | + if ($scalar === '' || is_null($scalar)) { |
|
503 | 503 | return null; |
504 | 504 | } |
505 | 505 | |
506 | - if(is_bool($scalar)) { |
|
506 | + if (is_bool($scalar)) { |
|
507 | 507 | return self::bool2string($scalar); |
508 | 508 | } |
509 | 509 | |
510 | - if(is_array($scalar)) { |
|
510 | + if (is_array($scalar)) { |
|
511 | 511 | $scalar = md5(serialize($scalar)); |
512 | 512 | } |
513 | 513 | |
514 | - if($scalar !== null && !is_scalar($scalar)) { |
|
514 | + if ($scalar !== null && !is_scalar($scalar)) { |
|
515 | 515 | throw new ConvertHelper_Exception( |
516 | 516 | 'Not a scalar value in comparison', |
517 | 517 | null, |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | * |
679 | 679 | * @see JSHelper::buildRegexStatement() |
680 | 680 | */ |
681 | - public static function regex2js(string $regex, string $statementType=JSHelper::JS_REGEX_OBJECT) |
|
681 | + public static function regex2js(string $regex, string $statementType = JSHelper::JS_REGEX_OBJECT) |
|
682 | 682 | { |
683 | 683 | return JSHelper::buildRegexStatement($regex, $statementType); |
684 | 684 | } |
@@ -695,11 +695,11 @@ discard block |
||
695 | 695 | * @throws ConvertHelper_Exception |
696 | 696 | * @return string |
697 | 697 | */ |
698 | - public static function var2json($variable, int $options=0, int $depth=512) : string |
|
698 | + public static function var2json($variable, int $options = 0, int $depth = 512) : string |
|
699 | 699 | { |
700 | 700 | $result = json_encode($variable, $options, $depth); |
701 | 701 | |
702 | - if($result !== false) { |
|
702 | + if ($result !== false) { |
|
703 | 703 | return $result; |
704 | 704 | } |
705 | 705 | |
@@ -724,10 +724,10 @@ discard block |
||
724 | 724 | public static function stripUTFBom($string) |
725 | 725 | { |
726 | 726 | $boms = FileHelper::getUTFBOMs(); |
727 | - foreach($boms as $bomChars) { |
|
727 | + foreach ($boms as $bomChars) { |
|
728 | 728 | $length = mb_strlen($bomChars); |
729 | 729 | $text = mb_substr($string, 0, $length); |
730 | - if($text==$bomChars) { |
|
730 | + if ($text == $bomChars) { |
|
731 | 731 | return mb_substr($string, $length); |
732 | 732 | } |
733 | 733 | } |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | * @param array $options |
795 | 795 | * @return float |
796 | 796 | */ |
797 | - public static function matchString($source, $target, $options=array()) |
|
797 | + public static function matchString($source, $target, $options = array()) |
|
798 | 798 | { |
799 | 799 | $defaults = array( |
800 | 800 | 'maxLevenshtein' => 10, |
@@ -804,12 +804,12 @@ discard block |
||
804 | 804 | $options = array_merge($defaults, $options); |
805 | 805 | |
806 | 806 | // avoid doing this via levenshtein |
807 | - if($source == $target) { |
|
807 | + if ($source == $target) { |
|
808 | 808 | return 100; |
809 | 809 | } |
810 | 810 | |
811 | 811 | $diff = levenshtein($source, $target); |
812 | - if($diff > $options['maxLevenshtein']) { |
|
812 | + if ($diff > $options['maxLevenshtein']) { |
|
813 | 813 | return 0; |
814 | 814 | } |
815 | 815 | |
@@ -893,24 +893,24 @@ discard block |
||
893 | 893 | * @see ConvertHelper::INTERVAL_HOURS |
894 | 894 | * @see ConvertHelper::INTERVAL_DAYS |
895 | 895 | */ |
896 | - public static function interval2total(\DateInterval $interval, $unit=self::INTERVAL_SECONDS) : int |
|
896 | + public static function interval2total(\DateInterval $interval, $unit = self::INTERVAL_SECONDS) : int |
|
897 | 897 | { |
898 | 898 | $total = (int)$interval->format('%a'); |
899 | 899 | if ($unit == self::INTERVAL_DAYS) { |
900 | 900 | return $total; |
901 | 901 | } |
902 | 902 | |
903 | - $total = ($total * 24) + ((int)$interval->h ); |
|
903 | + $total = ($total * 24) + ((int)$interval->h); |
|
904 | 904 | if ($unit == self::INTERVAL_HOURS) { |
905 | 905 | return $total; |
906 | 906 | } |
907 | 907 | |
908 | - $total = ($total * 60) + ((int)$interval->i ); |
|
908 | + $total = ($total * 60) + ((int)$interval->i); |
|
909 | 909 | if ($unit == self::INTERVAL_MINUTES) { |
910 | 910 | return $total; |
911 | 911 | } |
912 | 912 | |
913 | - $total = ($total * 60) + ((int)$interval->s ); |
|
913 | + $total = ($total * 60) + ((int)$interval->s); |
|
914 | 914 | if ($unit == self::INTERVAL_SECONDS) { |
915 | 915 | return $total; |
916 | 916 | } |
@@ -939,13 +939,13 @@ discard block |
||
939 | 939 | * @param bool $short |
940 | 940 | * @return string|NULL |
941 | 941 | */ |
942 | - public static function date2dayName(DateTime $date, bool $short=false) |
|
942 | + public static function date2dayName(DateTime $date, bool $short = false) |
|
943 | 943 | { |
944 | 944 | $day = $date->format('l'); |
945 | 945 | $invariant = self::getDayNamesInvariant(); |
946 | 946 | |
947 | 947 | $idx = array_search($day, $invariant); |
948 | - if($idx !== false) { |
|
948 | + if ($idx !== false) { |
|
949 | 949 | $localized = self::getDayNames($short); |
950 | 950 | return $localized[$idx]; |
951 | 951 | } |
@@ -968,10 +968,10 @@ discard block |
||
968 | 968 | * @param bool $short |
969 | 969 | * @return array |
970 | 970 | */ |
971 | - public static function getDayNames(bool $short=false) : array |
|
971 | + public static function getDayNames(bool $short = false) : array |
|
972 | 972 | { |
973 | - if($short) { |
|
974 | - if(!isset(self::$daysShort)) { |
|
973 | + if ($short) { |
|
974 | + if (!isset(self::$daysShort)) { |
|
975 | 975 | self::$daysShort = array( |
976 | 976 | t('Mon'), |
977 | 977 | t('Tue'), |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | return self::$daysShort; |
987 | 987 | } |
988 | 988 | |
989 | - if(!isset(self::$days)) { |
|
989 | + if (!isset(self::$days)) { |
|
990 | 990 | self::$days = array( |
991 | 991 | t('Monday'), |
992 | 992 | t('Tuesday'), |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | * @param bool $caseInsensitive |
1142 | 1142 | * @return ConvertHelper_StringMatch[] |
1143 | 1143 | */ |
1144 | - public static function findString(string $needle, string $haystack, bool $caseInsensitive=false): array |
|
1144 | + public static function findString(string $needle, string $haystack, bool $caseInsensitive = false): array |
|
1145 | 1145 | { |
1146 | 1146 | return ConvertHelper_String::findString($needle, $haystack, $caseInsensitive); |
1147 | 1147 | } |
@@ -1191,17 +1191,17 @@ discard block |
||
1191 | 1191 | */ |
1192 | 1192 | public static function isInteger($value) : bool |
1193 | 1193 | { |
1194 | - if(is_int($value)) { |
|
1194 | + if (is_int($value)) { |
|
1195 | 1195 | return true; |
1196 | 1196 | } |
1197 | 1197 | |
1198 | 1198 | // booleans get converted to numbers, so they would |
1199 | 1199 | // actually match the regex. |
1200 | - if(is_bool($value)) { |
|
1200 | + if (is_bool($value)) { |
|
1201 | 1201 | return false; |
1202 | 1202 | } |
1203 | 1203 | |
1204 | - if(is_string($value) && $value !== '') { |
|
1204 | + if (is_string($value) && $value !== '') { |
|
1205 | 1205 | return preg_match('/\A-?\d+\z/', $value) === 1; |
1206 | 1206 | } |
1207 | 1207 | |
@@ -1259,7 +1259,7 @@ discard block |
||
1259 | 1259 | return new ConvertHelper_URLFinder($subject); |
1260 | 1260 | } |
1261 | 1261 | |
1262 | - public static function arrayRemoveValues(array $sourceArray, array $values, bool $keepKeys=false) : array |
|
1262 | + public static function arrayRemoveValues(array $sourceArray, array $values, bool $keepKeys = false) : array |
|
1263 | 1263 | { |
1264 | 1264 | return ConvertHelper_Array::removeValues($sourceArray, $values, $keepKeys); |
1265 | 1265 | } |