@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | public static function getString($name, $default = '', $hash = 'default', $mask = 0) |
238 | 238 | { |
239 | 239 | // Cast to string, in case static::MASK_ALLOW_RAW was specified for mask |
240 | - return (string) static::getVar($name, $default, $hash, 'string', $mask); |
|
240 | + return (string)static::getVar($name, $default, $hash, 'string', $mask); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public static function getText($name, $default = '', $hash = 'default') |
267 | 267 | { |
268 | - return (string) static::getVar($name, $default, $hash, 'string', static::MASK_ALLOW_RAW); |
|
268 | + return (string)static::getVar($name, $default, $hash, 'string', static::MASK_ALLOW_RAW); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public static function getUrl($name, $default = '', $hash = 'default') |
281 | 281 | { |
282 | - return (string) static::getVar($name, $default, $hash, 'weburl'); |
|
282 | + return (string)static::getVar($name, $default, $hash, 'weburl'); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | /** |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | */ |
294 | 294 | public static function getPath($name, $default = '', $hash = 'default') |
295 | 295 | { |
296 | - return (string) static::getVar($name, $default, $hash, 'path'); |
|
296 | + return (string)static::getVar($name, $default, $hash, 'path'); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | /** |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public static function getEmail($name, $default = '', $hash = 'default') |
309 | 309 | { |
310 | - $ret = (string) static::getVar($name, $default, $hash, 'email'); |
|
310 | + $ret = (string)static::getVar($name, $default, $hash, 'email'); |
|
311 | 311 | return empty($ret) ? $default : $ret; |
312 | 312 | } |
313 | 313 | |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | */ |
323 | 323 | public static function getIP($name, $default = '', $hash = 'default') |
324 | 324 | { |
325 | - $ret = (string) static::getVar($name, $default, $hash, 'ip'); |
|
325 | + $ret = (string)static::getVar($name, $default, $hash, 'ip'); |
|
326 | 326 | return empty($ret) ? $default : $ret; |
327 | 327 | } |
328 | 328 |
@@ -69,15 +69,15 @@ discard block |
||
69 | 69 | $encoding = static::ENCODING; |
70 | 70 | return preg_replace_callback( |
71 | 71 | '#((?:(?!<[/a-z]).)*)([^>]*>|$)#si', |
72 | - function ($capture) use ($needle, $pre, $post, $encoding) { |
|
72 | + function($capture) use ($needle, $pre, $post, $encoding) { |
|
73 | 73 | $haystack = $capture[1]; |
74 | 74 | if (function_exists('mb_substr')) { |
75 | 75 | $p1 = mb_stripos($haystack, $needle, 0, $encoding); |
76 | 76 | $l1 = mb_strlen($needle, $encoding); |
77 | 77 | $ret = ''; |
78 | 78 | while ($p1 !== false) { |
79 | - $ret .= mb_substr($haystack, 0, $p1, $encoding) . $pre |
|
80 | - . mb_substr($haystack, $p1, $l1, $encoding) . $post; |
|
79 | + $ret .= mb_substr($haystack, 0, $p1, $encoding).$pre |
|
80 | + . mb_substr($haystack, $p1, $l1, $encoding).$post; |
|
81 | 81 | $haystack = mb_substr($haystack, $p1 + $l1, mb_strlen($haystack), $encoding); |
82 | 82 | $p1 = mb_stripos($haystack, $needle, 0, $encoding); |
83 | 83 | } |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | $l1 = strlen($needle); |
87 | 87 | $ret = ''; |
88 | 88 | while ($p1 !== false) { |
89 | - $ret .= substr($haystack, 0, $p1) . $pre . substr($haystack, $p1, $l1) . $post; |
|
89 | + $ret .= substr($haystack, 0, $p1).$pre.substr($haystack, $p1, $l1).$post; |
|
90 | 90 | $haystack = substr($haystack, $p1 + $l1); |
91 | 91 | $p1 = stripos($haystack, $needle); |
92 | 92 | } |
93 | 93 | } |
94 | - $ret .= $haystack . $capture[2]; |
|
94 | + $ret .= $haystack.$capture[2]; |
|
95 | 95 | |
96 | 96 | return $ret; |
97 | 97 | }, |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | private static $language = 'neutral'; |
73 | 73 | private static $internalEncoding = 'UTF-8'; |
74 | 74 | private static $caseFold = array( |
75 | - array('µ','ſ',"\xCD\x85",'ς',"\xCF\x90","\xCF\x91","\xCF\x95","\xCF\x96","\xCF\xB0","\xCF\xB1","\xCF\xB5","\xE1\xBA\x9B","\xE1\xBE\xBE"), |
|
76 | - array('μ','s','ι', 'σ','β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1",'ι'), |
|
75 | + array('µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"), |
|
76 | + array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'), |
|
77 | 77 | ); |
78 | 78 | |
79 | 79 | public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); |
120 | 120 | |
121 | 121 | $ok = true; |
122 | - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { |
|
122 | + array_walk_recursive($vars, function(&$v) use (&$ok, $toEncoding, $fromEncoding) { |
|
123 | 123 | if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { |
124 | 124 | $ok = false; |
125 | 125 | } |
@@ -151,10 +151,10 @@ discard block |
||
151 | 151 | |
152 | 152 | if (null !== $encoding && !\is_scalar($encoding)) { |
153 | 153 | trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); |
154 | - return ''; // Instead of null (cf. mb_encode_numericentity). |
|
154 | + return ''; // Instead of null (cf. mb_encode_numericentity). |
|
155 | 155 | } |
156 | 156 | |
157 | - $s = (string) $s; |
|
157 | + $s = (string)$s; |
|
158 | 158 | if ('' === $s) { |
159 | 159 | return ''; |
160 | 160 | } |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | $convmap[$i + 1] += $convmap[$i + 2]; |
179 | 179 | } |
180 | 180 | |
181 | - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { |
|
182 | - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; |
|
181 | + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function(array $m) use ($cnt, $convmap) { |
|
182 | + $c = isset($m[2]) ? (int)hexdec($m[2]) : $m[1]; |
|
183 | 183 | for ($i = 0; $i < $cnt; $i += 4) { |
184 | 184 | if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { |
185 | 185 | return Mbstring::mb_chr($c - $convmap[$i + 2]); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | if (null !== $encoding && !\is_scalar($encoding)) { |
210 | 210 | trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); |
211 | - return null; // Instead of '' (cf. mb_decode_numericentity). |
|
211 | + return null; // Instead of '' (cf. mb_decode_numericentity). |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | if (null !== $is_hex && !\is_scalar($is_hex)) { |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | return null; |
217 | 217 | } |
218 | 218 | |
219 | - $s = (string) $s; |
|
219 | + $s = (string)$s; |
|
220 | 220 | if ('' === $s) { |
221 | 221 | return ''; |
222 | 222 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | |
265 | 265 | public static function mb_convert_case($s, $mode, $encoding = null) |
266 | 266 | { |
267 | - $s = (string) $s; |
|
267 | + $s = (string)$s; |
|
268 | 268 | if ('' === $s) { |
269 | 269 | return ''; |
270 | 270 | } |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | return strpos($haystack, $needle, $offset); |
481 | 481 | } |
482 | 482 | |
483 | - $needle = (string) $needle; |
|
483 | + $needle = (string)$needle; |
|
484 | 484 | if ('' === $needle) { |
485 | 485 | trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); |
486 | 486 | |
@@ -497,9 +497,9 @@ discard block |
||
497 | 497 | return strrpos($haystack, $needle, $offset); |
498 | 498 | } |
499 | 499 | |
500 | - if ($offset != (int) $offset) { |
|
500 | + if ($offset != (int)$offset) { |
|
501 | 501 | $offset = 0; |
502 | - } elseif ($offset = (int) $offset) { |
|
502 | + } elseif ($offset = (int)$offset) { |
|
503 | 503 | if ($offset < 0) { |
504 | 504 | $haystack = self::mb_substr($haystack, 0, $offset, $encoding); |
505 | 505 | $offset = 0; |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | } |
556 | 556 | } |
557 | 557 | |
558 | - return (string) iconv_substr($s, $start, $length, $encoding); |
|
558 | + return (string)iconv_substr($s, $start, $length, $encoding); |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) |
@@ -29,19 +29,19 @@ |
||
29 | 29 | // on the input arrays. This ordering of the characters avoids the use of strtr, |
30 | 30 | // which performs more slowly. |
31 | 31 | private static $escapees = array('\\', '\\\\', '\\"', '"', |
32 | - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
36 | - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", |
|
37 | - ); |
|
32 | + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
36 | + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", |
|
37 | + ); |
|
38 | 38 | private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', |
39 | - '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
40 | - '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
41 | - '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', |
|
42 | - '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
43 | - '\\N', '\\_', '\\L', '\\P', |
|
44 | - ); |
|
39 | + '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
40 | + '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
41 | + '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', |
|
42 | + '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
43 | + '\\N', '\\_', '\\L', '\\P', |
|
44 | + ); |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Determines if a PHP value would require double quoting in YAML. |
@@ -29,17 +29,17 @@ |
||
29 | 29 | // on the input arrays. This ordering of the characters avoids the use of strtr, |
30 | 30 | // which performs more slowly. |
31 | 31 | private static $escapees = array('\\', '\\\\', '\\"', '"', |
32 | - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
32 | + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
36 | 36 | "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", |
37 | 37 | ); |
38 | 38 | private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', |
39 | - '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
40 | - '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
39 | + '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
40 | + '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
41 | 41 | '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', |
42 | - '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
42 | + '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
43 | 43 | '\\N', '\\_', '\\L', '\\P', |
44 | 44 | ); |
45 | 45 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | return ''; |
53 | 53 | } |
54 | 54 | |
55 | - if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { |
|
55 | + if (2 /* MB_OVERLOAD_STRING */ & (int)ini_get('mbstring.func_overload')) { |
|
56 | 56 | $mbEncoding = mb_internal_encoding(); |
57 | 57 | mb_internal_encoding('ASCII'); |
58 | 58 | } |
@@ -122,14 +122,14 @@ discard block |
||
122 | 122 | case false === $value: |
123 | 123 | return 'false'; |
124 | 124 | case ctype_digit($value): |
125 | - return is_string($value) ? "'$value'" : (int) $value; |
|
125 | + return is_string($value) ? "'$value'" : (int)$value; |
|
126 | 126 | case is_numeric($value): |
127 | 127 | $locale = setlocale(LC_NUMERIC, 0); |
128 | 128 | if (false !== $locale) { |
129 | 129 | setlocale(LC_NUMERIC, 'C'); |
130 | 130 | } |
131 | 131 | if (is_float($value)) { |
132 | - $repr = (string) $value; |
|
132 | + $repr = (string)$value; |
|
133 | 133 | if (is_infinite($value)) { |
134 | 134 | $repr = str_ireplace('INF', '.Inf', $repr); |
135 | 135 | } elseif (floor($value) == $value && $repr == $value) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $repr = '!!float '.$repr; |
138 | 138 | } |
139 | 139 | } else { |
140 | - $repr = is_string($value) ? "'$value'" : (string) $value; |
|
140 | + $repr = is_string($value) ? "'$value'" : (string)$value; |
|
141 | 141 | } |
142 | 142 | if (false !== $locale) { |
143 | 143 | setlocale(LC_NUMERIC, $locale); |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | continue 2; |
390 | 390 | case '}': |
391 | 391 | if (self::$objectForMap) { |
392 | - return (object) $output; |
|
392 | + return (object)$output; |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | return $output; |
@@ -513,9 +513,9 @@ discard block |
||
513 | 513 | case '+' === $scalar[0] || '-' === $scalar[0] || '.' === $scalar[0] || '!' === $scalar[0] || is_numeric($scalar[0]): |
514 | 514 | switch (true) { |
515 | 515 | case 0 === strpos($scalar, '!str'): |
516 | - return (string) substr($scalar, 5); |
|
516 | + return (string)substr($scalar, 5); |
|
517 | 517 | case 0 === strpos($scalar, '! '): |
518 | - return (int) self::parseScalar(substr($scalar, 2)); |
|
518 | + return (int)self::parseScalar(substr($scalar, 2)); |
|
519 | 519 | case 0 === strpos($scalar, '!php/object:'): |
520 | 520 | if (self::$objectSupport) { |
521 | 521 | return unserialize(substr($scalar, 12)); |
@@ -537,27 +537,27 @@ discard block |
||
537 | 537 | |
538 | 538 | return; |
539 | 539 | case 0 === strpos($scalar, '!!float '): |
540 | - return (float) substr($scalar, 8); |
|
540 | + return (float)substr($scalar, 8); |
|
541 | 541 | case ctype_digit($scalar): |
542 | 542 | $raw = $scalar; |
543 | - $cast = (int) $scalar; |
|
543 | + $cast = (int)$scalar; |
|
544 | 544 | |
545 | - return '0' == $scalar[0] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); |
|
545 | + return '0' == $scalar[0] ? octdec($scalar) : (((string)$raw == (string)$cast) ? $cast : $raw); |
|
546 | 546 | case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): |
547 | 547 | $raw = $scalar; |
548 | - $cast = (int) $scalar; |
|
548 | + $cast = (int)$scalar; |
|
549 | 549 | |
550 | - return '0' == $scalar[1] ? octdec($scalar) : (((string) $raw === (string) $cast) ? $cast : $raw); |
|
550 | + return '0' == $scalar[1] ? octdec($scalar) : (((string)$raw === (string)$cast) ? $cast : $raw); |
|
551 | 551 | case is_numeric($scalar): |
552 | 552 | case Parser::preg_match(self::getHexRegex(), $scalar): |
553 | - return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; |
|
553 | + return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float)$scalar; |
|
554 | 554 | case '.inf' === $scalarLower: |
555 | 555 | case '.nan' === $scalarLower: |
556 | 556 | return -log(0); |
557 | 557 | case '-.inf' === $scalarLower: |
558 | 558 | return log(0); |
559 | 559 | case Parser::preg_match('/^(-|\+)?[0-9,]+(\.[0-9]+)?$/', $scalar): |
560 | - return (float) str_replace(',', '', $scalar); |
|
560 | + return (float)str_replace(',', '', $scalar); |
|
561 | 561 | case Parser::preg_match(self::getTimestampRegex(), $scalar): |
562 | 562 | $timeZone = date_default_timezone_get(); |
563 | 563 | date_default_timezone_set('UTC'); |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | } |
569 | 569 | // no break |
570 | 570 | default: |
571 | - return (string) $scalar; |
|
571 | + return (string)$scalar; |
|
572 | 572 | } |
573 | 573 | } |
574 | 574 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | throw new \InvalidArgumentException('The indentation must be greater than zero.'); |
37 | 37 | } |
38 | 38 | |
39 | - $this->indentation = (int) $num; |
|
39 | + $this->indentation = (int)$num; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -370,41 +370,41 @@ |
||
370 | 370 | array('[\'foo,bar\', \'foo bar\']', array('foo,bar', 'foo bar')), |
371 | 371 | |
372 | 372 | // mappings |
373 | - array('{foo:bar,bar:foo,false:false,null:null,integer:12}', (object) array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), |
|
374 | - array('{ foo : bar, bar : foo, false : false, null : null, integer : 12 }', (object) array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), |
|
375 | - array('{foo: \'bar\', bar: \'foo: bar\'}', (object) array('foo' => 'bar', 'bar' => 'foo: bar')), |
|
376 | - array('{\'foo\': \'bar\', "bar": \'foo: bar\'}', (object) array('foo' => 'bar', 'bar' => 'foo: bar')), |
|
377 | - array('{\'foo\'\'\': \'bar\', "bar\"": \'foo: bar\'}', (object) array('foo\'' => 'bar', 'bar"' => 'foo: bar')), |
|
378 | - array('{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}', (object) array('foo: ' => 'bar', 'bar: ' => 'foo: bar')), |
|
373 | + array('{foo:bar,bar:foo,false:false,null:null,integer:12}', (object)array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), |
|
374 | + array('{ foo : bar, bar : foo, false : false, null : null, integer : 12 }', (object)array('foo' => 'bar', 'bar' => 'foo', 'false' => false, 'null' => null, 'integer' => 12)), |
|
375 | + array('{foo: \'bar\', bar: \'foo: bar\'}', (object)array('foo' => 'bar', 'bar' => 'foo: bar')), |
|
376 | + array('{\'foo\': \'bar\', "bar": \'foo: bar\'}', (object)array('foo' => 'bar', 'bar' => 'foo: bar')), |
|
377 | + array('{\'foo\'\'\': \'bar\', "bar\"": \'foo: bar\'}', (object)array('foo\'' => 'bar', 'bar"' => 'foo: bar')), |
|
378 | + array('{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}', (object)array('foo: ' => 'bar', 'bar: ' => 'foo: bar')), |
|
379 | 379 | |
380 | 380 | // nested sequences and mappings |
381 | 381 | array('[foo, [bar, foo]]', array('foo', array('bar', 'foo'))), |
382 | - array('[foo, {bar: foo}]', array('foo', (object) array('bar' => 'foo'))), |
|
383 | - array('{ foo: {bar: foo} }', (object) array('foo' => (object) array('bar' => 'foo'))), |
|
384 | - array('{ foo: [bar, foo] }', (object) array('foo' => array('bar', 'foo'))), |
|
382 | + array('[foo, {bar: foo}]', array('foo', (object)array('bar' => 'foo'))), |
|
383 | + array('{ foo: {bar: foo} }', (object)array('foo' => (object)array('bar' => 'foo'))), |
|
384 | + array('{ foo: [bar, foo] }', (object)array('foo' => array('bar', 'foo'))), |
|
385 | 385 | |
386 | 386 | array('[ foo, [ bar, foo ] ]', array('foo', array('bar', 'foo'))), |
387 | 387 | |
388 | - array('[{ foo: {bar: foo} }]', array((object) array('foo' => (object) array('bar' => 'foo')))), |
|
388 | + array('[{ foo: {bar: foo} }]', array((object)array('foo' => (object)array('bar' => 'foo')))), |
|
389 | 389 | |
390 | 390 | array('[foo, [bar, [foo, [bar, foo]], foo]]', array('foo', array('bar', array('foo', array('bar', 'foo')), 'foo'))), |
391 | 391 | |
392 | - array('[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]', array('foo', (object) array('bar' => 'foo', 'foo' => array('foo', (object) array('bar' => 'foo'))), array('foo', (object) array('bar' => 'foo')))), |
|
392 | + array('[foo, {bar: foo, foo: [foo, {bar: foo}]}, [foo, {bar: foo}]]', array('foo', (object)array('bar' => 'foo', 'foo' => array('foo', (object)array('bar' => 'foo'))), array('foo', (object)array('bar' => 'foo')))), |
|
393 | 393 | |
394 | - array('[foo, bar: { foo: bar }]', array('foo', '1' => (object) array('bar' => (object) array('foo' => 'bar')))), |
|
395 | - array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', (object) array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), |
|
394 | + array('[foo, bar: { foo: bar }]', array('foo', '1' => (object)array('bar' => (object)array('foo' => 'bar')))), |
|
395 | + array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', (object)array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), |
|
396 | 396 | |
397 | 397 | array('{}', new \stdClass()), |
398 | - array('{ foo : bar, bar : {} }', (object) array('foo' => 'bar', 'bar' => new \stdClass())), |
|
399 | - array('{ foo : [], bar : {} }', (object) array('foo' => array(), 'bar' => new \stdClass())), |
|
400 | - array('{foo: \'bar\', bar: {} }', (object) array('foo' => 'bar', 'bar' => new \stdClass())), |
|
401 | - array('{\'foo\': \'bar\', "bar": {}}', (object) array('foo' => 'bar', 'bar' => new \stdClass())), |
|
402 | - array('{\'foo\': \'bar\', "bar": \'{}\'}', (object) array('foo' => 'bar', 'bar' => '{}')), |
|
398 | + array('{ foo : bar, bar : {} }', (object)array('foo' => 'bar', 'bar' => new \stdClass())), |
|
399 | + array('{ foo : [], bar : {} }', (object)array('foo' => array(), 'bar' => new \stdClass())), |
|
400 | + array('{foo: \'bar\', bar: {} }', (object)array('foo' => 'bar', 'bar' => new \stdClass())), |
|
401 | + array('{\'foo\': \'bar\', "bar": {}}', (object)array('foo' => 'bar', 'bar' => new \stdClass())), |
|
402 | + array('{\'foo\': \'bar\', "bar": \'{}\'}', (object)array('foo' => 'bar', 'bar' => '{}')), |
|
403 | 403 | |
404 | 404 | array('[foo, [{}, {}]]', array('foo', array(new \stdClass(), new \stdClass()))), |
405 | 405 | array('[foo, [[], {}]]', array('foo', array(array(), new \stdClass()))), |
406 | 406 | array('[foo, [[{}, {}], {}]]', array('foo', array(array(new \stdClass(), new \stdClass()), new \stdClass()))), |
407 | - array('[foo, {bar: {}}]', array('foo', '1' => (object) array('bar' => new \stdClass()))), |
|
407 | + array('[foo, {bar: {}}]', array('foo', '1' => (object)array('bar' => new \stdClass()))), |
|
408 | 408 | ); |
409 | 409 | } |
410 | 410 |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $e = null; |
70 | 70 | $data = null; |
71 | 71 | |
72 | - if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { |
|
72 | + if (2 /* MB_OVERLOAD_STRING */ & (int)ini_get('mbstring.func_overload')) { |
|
73 | 73 | $mbEncoding = mb_internal_encoding(); |
74 | 74 | mb_internal_encoding('UTF-8'); |
75 | 75 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | // Convert float keys to strings, to avoid being converted to integers by PHP |
180 | 180 | if (is_float($key)) { |
181 | - $key = (string) $key; |
|
181 | + $key = (string)$key; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | if ('<<' === $key && (!isset($values['value']) || !self::preg_match('#^&(?P<ref>[^ ]+)#u', $values['value'], $refMatches))) { |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | if (self::preg_match('/^'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { |
530 | 530 | $modifiers = isset($matches['modifiers']) ? $matches['modifiers'] : ''; |
531 | 531 | |
532 | - return $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int) abs($modifiers)); |
|
532 | + return $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), (int)abs($modifiers)); |
|
533 | 533 | } |
534 | 534 | |
535 | 535 | try { |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | */ |
806 | 806 | private function isBlockScalarHeader() |
807 | 807 | { |
808 | - return (bool) self::preg_match('~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~', $this->currentLine); |
|
808 | + return (bool)self::preg_match('~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~', $this->currentLine); |
|
809 | 809 | } |
810 | 810 | |
811 | 811 | /** |
@@ -58,7 +58,7 @@ |
||
58 | 58 | public function unescapeDoubleQuotedString($value) |
59 | 59 | { |
60 | 60 | $self = $this; |
61 | - $callback = function ($match) use ($self) { |
|
61 | + $callback = function($match) use ($self) { |
|
62 | 62 | return $self->unescapeCharacter($match[0]); |
63 | 63 | }; |
64 | 64 |