@@ -29,7 +29,7 @@ |
||
29 | 29 | private function stopWatch(float $script_start): float |
30 | 30 | { |
31 | 31 | list($usec, $sec) = explode(' ', microtime()); |
32 | - $script_end = (float) $sec + (float) $usec; |
|
32 | + $script_end = (float)$sec + (float)$usec; |
|
33 | 33 | |
34 | 34 | return round($script_end - $script_start, 5); |
35 | 35 | } |
@@ -44,12 +44,12 @@ |
||
44 | 44 | |
45 | 45 | private function configure(EventDispatcherInterface $eventDispatcher): void |
46 | 46 | { |
47 | - $this->listNodeProcessor[UseUse::class] = function (Node $node) use ($eventDispatcher): object { |
|
47 | + $this->listNodeProcessor[UseUse::class] = function(Node $node) use ($eventDispatcher): object { |
|
48 | 48 | /** @var UseUse $node */ |
49 | 49 | return $eventDispatcher->dispatch(new FoundUseNamespace($node->getStartLine(), $node->name->toCodeString())); |
50 | 50 | }; |
51 | 51 | |
52 | - $this->listNodeProcessor[FullyQualified::class] = function (Node $node) use ($eventDispatcher): object { |
|
52 | + $this->listNodeProcessor[FullyQualified::class] = function(Node $node) use ($eventDispatcher): object { |
|
53 | 53 | /** @var FullyQualified $node */ |
54 | 54 | return $eventDispatcher->dispatch(new FoundUseNamespace($node->getStartLine(), $node->toCodeString())); |
55 | 55 | }; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 'A' => 'a', |
5 | 5 | 'B' => 'b', |
6 | 6 | 'C' => 'c', |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 'a' => 'A', |
5 | 5 | 'b' => 'B', |
6 | 6 | 'c' => 'C', |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | use Symfony\Polyfill\Mbstring as p; |
13 | 13 | |
14 | 14 | if (\PHP_VERSION_ID >= 80000) { |
15 | - return require __DIR__.'/bootstrap80.php'; |
|
15 | + return require __DIR__ . '/bootstrap80.php'; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | if (!function_exists('mb_convert_encoding')) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } |
56 | 56 | } |
57 | 57 | if (!function_exists('mb_parse_str')) { |
58 | - function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } |
|
58 | + function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool)$result; } |
|
59 | 59 | } |
60 | 60 | if (!function_exists('mb_strlen')) { |
61 | 61 | function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | private static $internalEncoding = 'UTF-8'; |
75 | 75 | private static $caseFold = [ |
76 | 76 | ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], |
77 | - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], |
|
77 | + ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], |
|
78 | 78 | ]; |
79 | 79 | |
80 | 80 | public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) |
@@ -112,13 +112,13 @@ discard block |
||
112 | 112 | $fromEncoding = 'UTF-8'; |
113 | 113 | } |
114 | 114 | |
115 | - return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s); |
|
115 | + return \iconv($fromEncoding, $toEncoding . '//IGNORE', $s); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) |
119 | 119 | { |
120 | 120 | $ok = true; |
121 | - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { |
|
121 | + array_walk_recursive($vars, function(&$v) use (&$ok, $toEncoding, $fromEncoding) { |
|
122 | 122 | if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { |
123 | 123 | $ok = false; |
124 | 124 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | public static function mb_decode_numericentity($s, $convmap, $encoding = null) |
141 | 141 | { |
142 | 142 | if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { |
143 | - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); |
|
143 | + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
144 | 144 | |
145 | 145 | return null; |
146 | 146 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | } |
151 | 151 | |
152 | 152 | if (null !== $encoding && !is_scalar($encoding)) { |
153 | - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); |
|
153 | + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
154 | 154 | |
155 | - return ''; // Instead of null (cf. mb_encode_numericentity). |
|
155 | + return ''; // Instead of null (cf. mb_encode_numericentity). |
|
156 | 156 | } |
157 | 157 | |
158 | - $s = (string) $s; |
|
158 | + $s = (string)$s; |
|
159 | 159 | if ('' === $s) { |
160 | 160 | return ''; |
161 | 161 | } |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | $convmap[$i + 1] += $convmap[$i + 2]; |
180 | 180 | } |
181 | 181 | |
182 | - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { |
|
183 | - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; |
|
182 | + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function(array $m) use ($cnt, $convmap) { |
|
183 | + $c = isset($m[2]) ? (int)hexdec($m[2]) : $m[1]; |
|
184 | 184 | for ($i = 0; $i < $cnt; $i += 4) { |
185 | 185 | if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { |
186 | 186 | return self::mb_chr($c - $convmap[$i + 2]); |
@@ -194,13 +194,13 @@ discard block |
||
194 | 194 | return $s; |
195 | 195 | } |
196 | 196 | |
197 | - return \iconv('UTF-8', $encoding.'//IGNORE', $s); |
|
197 | + return \iconv('UTF-8', $encoding . '//IGNORE', $s); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) |
201 | 201 | { |
202 | 202 | if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { |
203 | - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); |
|
203 | + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
204 | 204 | |
205 | 205 | return null; |
206 | 206 | } |
@@ -210,18 +210,18 @@ discard block |
||
210 | 210 | } |
211 | 211 | |
212 | 212 | if (null !== $encoding && !is_scalar($encoding)) { |
213 | - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); |
|
213 | + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
214 | 214 | |
215 | - return null; // Instead of '' (cf. mb_decode_numericentity). |
|
215 | + return null; // Instead of '' (cf. mb_decode_numericentity). |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | if (null !== $is_hex && !is_scalar($is_hex)) { |
219 | - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); |
|
219 | + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, ' . \gettype($s) . ' given', \E_USER_WARNING); |
|
220 | 220 | |
221 | 221 | return null; |
222 | 222 | } |
223 | 223 | |
224 | - $s = (string) $s; |
|
224 | + $s = (string)$s; |
|
225 | 225 | if ('' === $s) { |
226 | 226 | return ''; |
227 | 227 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | for ($j = 0; $j < $cnt; $j += 4) { |
254 | 254 | if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { |
255 | 255 | $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; |
256 | - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; |
|
256 | + $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#' . $cOffset . ';'; |
|
257 | 257 | continue 2; |
258 | 258 | } |
259 | 259 | } |
@@ -264,12 +264,12 @@ discard block |
||
264 | 264 | return $result; |
265 | 265 | } |
266 | 266 | |
267 | - return \iconv('UTF-8', $encoding.'//IGNORE', $result); |
|
267 | + return \iconv('UTF-8', $encoding . '//IGNORE', $result); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | public static function mb_convert_case($s, $mode, $encoding = null) |
271 | 271 | { |
272 | - $s = (string) $s; |
|
272 | + $s = (string)$s; |
|
273 | 273 | if ('' === $s) { |
274 | 274 | return ''; |
275 | 275 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | return $s; |
343 | 343 | } |
344 | 344 | |
345 | - return \iconv('UTF-8', $encoding.'//IGNORE', $s); |
|
345 | + return \iconv('UTF-8', $encoding . '//IGNORE', $s); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | public static function mb_internal_encoding($encoding = null) |
@@ -497,10 +497,10 @@ discard block |
||
497 | 497 | return strpos($haystack, $needle, $offset); |
498 | 498 | } |
499 | 499 | |
500 | - $needle = (string) $needle; |
|
500 | + $needle = (string)$needle; |
|
501 | 501 | if ('' === $needle) { |
502 | 502 | if (80000 > \PHP_VERSION_ID) { |
503 | - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); |
|
503 | + trigger_error(__METHOD__ . ': Empty delimiter', \E_USER_WARNING); |
|
504 | 504 | |
505 | 505 | return false; |
506 | 506 | } |
@@ -518,9 +518,9 @@ discard block |
||
518 | 518 | return strrpos($haystack, $needle, $offset); |
519 | 519 | } |
520 | 520 | |
521 | - if ($offset != (int) $offset) { |
|
521 | + if ($offset != (int)$offset) { |
|
522 | 522 | $offset = 0; |
523 | - } elseif ($offset = (int) $offset) { |
|
523 | + } elseif ($offset = (int)$offset) { |
|
524 | 524 | if ($offset < 0) { |
525 | 525 | if (0 > $offset += self::mb_strlen($needle)) { |
526 | 526 | $haystack = self::mb_substr($haystack, 0, $offset, $encoding); |
@@ -541,12 +541,12 @@ discard block |
||
541 | 541 | public static function mb_str_split($string, $split_length = 1, $encoding = null) |
542 | 542 | { |
543 | 543 | if (null !== $string && !is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { |
544 | - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); |
|
544 | + trigger_error('mb_str_split() expects parameter 1 to be string, ' . \gettype($string) . ' given', \E_USER_WARNING); |
|
545 | 545 | |
546 | 546 | return null; |
547 | 547 | } |
548 | 548 | |
549 | - if (1 > $split_length = (int) $split_length) { |
|
549 | + if (1 > $split_length = (int)$split_length) { |
|
550 | 550 | if (80000 > \PHP_VERSION_ID) { |
551 | 551 | trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); |
552 | 552 | return false; |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | $rx .= '.{65535}'; |
566 | 566 | $split_length -= 65535; |
567 | 567 | } |
568 | - $rx .= '.{'.$split_length.'})/us'; |
|
568 | + $rx .= '.{' . $split_length . '})/us'; |
|
569 | 569 | |
570 | 570 | return preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); |
571 | 571 | } |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | { |
610 | 610 | $encoding = self::getEncoding($encoding); |
611 | 611 | if ('CP850' === $encoding || 'ASCII' === $encoding) { |
612 | - return (string) substr($s, $start, null === $length ? 2147483647 : $length); |
|
612 | + return (string)substr($s, $start, null === $length ? 2147483647 : $length); |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | if ($start < 0) { |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | } |
629 | 629 | } |
630 | 630 | |
631 | - return (string) \iconv_substr($s, $start, $length, $encoding); |
|
631 | + return (string)\iconv_substr($s, $start, $length, $encoding); |
|
632 | 632 | } |
633 | 633 | |
634 | 634 | public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) |
@@ -755,11 +755,11 @@ discard block |
||
755 | 755 | if (0x80 > $code %= 0x200000) { |
756 | 756 | $s = \chr($code); |
757 | 757 | } elseif (0x800 > $code) { |
758 | - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); |
|
758 | + $s = \chr(0xC0 | $code >> 6) . \chr(0x80 | $code & 0x3F); |
|
759 | 759 | } elseif (0x10000 > $code) { |
760 | - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); |
|
760 | + $s = \chr(0xE0 | $code >> 12) . \chr(0x80 | $code >> 6 & 0x3F) . \chr(0x80 | $code & 0x3F); |
|
761 | 761 | } else { |
762 | - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); |
|
762 | + $s = \chr(0xF0 | $code >> 18) . \chr(0x80 | $code >> 12 & 0x3F) . \chr(0x80 | $code >> 6 & 0x3F) . \chr(0x80 | $code & 0x3F); |
|
763 | 763 | } |
764 | 764 | |
765 | 765 | if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; |
825 | 825 | } |
826 | 826 | |
827 | - $entities .= '&#'.$c.';'; |
|
827 | + $entities .= '&#' . $c . ';'; |
|
828 | 828 | } |
829 | 829 | |
830 | 830 | return $entities; |
@@ -832,12 +832,12 @@ discard block |
||
832 | 832 | |
833 | 833 | private static function title_case(array $s) |
834 | 834 | { |
835 | - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); |
|
835 | + return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8') . self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); |
|
836 | 836 | } |
837 | 837 | |
838 | 838 | private static function getData($file) |
839 | 839 | { |
840 | - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { |
|
840 | + if (file_exists($file = __DIR__ . '/Resources/unidata/' . $file . '.php')) { |
|
841 | 841 | return require $file; |
842 | 842 | } |
843 | 843 |
@@ -12,120 +12,120 @@ |
||
12 | 12 | use Symfony\Polyfill\Mbstring as p; |
13 | 13 | |
14 | 14 | if (!function_exists('mb_convert_encoding')) { |
15 | - function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } |
|
15 | + function mb_convert_encoding(array | string | null $string, ?string $to_encoding, array | string | null $from_encoding = null): array | string | false { return p\Mbstring::mb_convert_encoding($string ?? '', (string)$to_encoding, $from_encoding); } |
|
16 | 16 | } |
17 | 17 | if (!function_exists('mb_decode_mimeheader')) { |
18 | - function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } |
|
18 | + function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string)$string); } |
|
19 | 19 | } |
20 | 20 | if (!function_exists('mb_encode_mimeheader')) { |
21 | - function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } |
|
21 | + function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string)$string, $charset, $transfer_encoding, (string)$newline, (int)$indent); } |
|
22 | 22 | } |
23 | 23 | if (!function_exists('mb_decode_numericentity')) { |
24 | - function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } |
|
24 | + function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string)$string, $map, $encoding); } |
|
25 | 25 | } |
26 | 26 | if (!function_exists('mb_encode_numericentity')) { |
27 | - function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } |
|
27 | + function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string)$string, $map, $encoding, (bool)$hex); } |
|
28 | 28 | } |
29 | 29 | if (!function_exists('mb_convert_case')) { |
30 | - function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } |
|
30 | + function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string)$string, (int)$mode, $encoding); } |
|
31 | 31 | } |
32 | 32 | if (!function_exists('mb_internal_encoding')) { |
33 | - function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } |
|
33 | + function mb_internal_encoding(?string $encoding = null): string | bool { return p\Mbstring::mb_internal_encoding($encoding); } |
|
34 | 34 | } |
35 | 35 | if (!function_exists('mb_language')) { |
36 | - function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } |
|
36 | + function mb_language(?string $language = null): string | bool { return p\Mbstring::mb_language($language); } |
|
37 | 37 | } |
38 | 38 | if (!function_exists('mb_list_encodings')) { |
39 | 39 | function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } |
40 | 40 | } |
41 | 41 | if (!function_exists('mb_encoding_aliases')) { |
42 | - function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } |
|
42 | + function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string)$encoding); } |
|
43 | 43 | } |
44 | 44 | if (!function_exists('mb_check_encoding')) { |
45 | - function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } |
|
45 | + function mb_check_encoding(array | string | null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } |
|
46 | 46 | } |
47 | 47 | if (!function_exists('mb_detect_encoding')) { |
48 | - function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } |
|
48 | + function mb_detect_encoding(?string $string, array | string | null $encodings = null, ?bool $strict = false): string | false { return p\Mbstring::mb_detect_encoding((string)$string, $encodings, (bool)$strict); } |
|
49 | 49 | } |
50 | 50 | if (!function_exists('mb_detect_order')) { |
51 | - function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } |
|
51 | + function mb_detect_order(array | string | null $encoding = null): array | bool { return p\Mbstring::mb_detect_order($encoding); } |
|
52 | 52 | } |
53 | 53 | if (!function_exists('mb_parse_str')) { |
54 | - function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } |
|
54 | + function mb_parse_str(?string $string, &$result = []): bool { parse_str((string)$string, $result); return (bool)$result; } |
|
55 | 55 | } |
56 | 56 | if (!function_exists('mb_strlen')) { |
57 | - function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } |
|
57 | + function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string)$string, $encoding); } |
|
58 | 58 | } |
59 | 59 | if (!function_exists('mb_strpos')) { |
60 | - function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } |
|
60 | + function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int | false { return p\Mbstring::mb_strpos((string)$haystack, (string)$needle, (int)$offset, $encoding); } |
|
61 | 61 | } |
62 | 62 | if (!function_exists('mb_strtolower')) { |
63 | - function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } |
|
63 | + function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string)$string, $encoding); } |
|
64 | 64 | } |
65 | 65 | if (!function_exists('mb_strtoupper')) { |
66 | - function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } |
|
66 | + function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string)$string, $encoding); } |
|
67 | 67 | } |
68 | 68 | if (!function_exists('mb_substitute_character')) { |
69 | - function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } |
|
69 | + function mb_substitute_character(string | int | null $substitute_character = null): string | int | bool { return p\Mbstring::mb_substitute_character($substitute_character); } |
|
70 | 70 | } |
71 | 71 | if (!function_exists('mb_substr')) { |
72 | - function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } |
|
72 | + function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string)$string, (int)$start, $length, $encoding); } |
|
73 | 73 | } |
74 | 74 | if (!function_exists('mb_stripos')) { |
75 | - function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } |
|
75 | + function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int | false { return p\Mbstring::mb_stripos((string)$haystack, (string)$needle, (int)$offset, $encoding); } |
|
76 | 76 | } |
77 | 77 | if (!function_exists('mb_stristr')) { |
78 | - function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } |
|
78 | + function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string | false { return p\Mbstring::mb_stristr((string)$haystack, (string)$needle, (bool)$before_needle, $encoding); } |
|
79 | 79 | } |
80 | 80 | if (!function_exists('mb_strrchr')) { |
81 | - function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } |
|
81 | + function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string | false { return p\Mbstring::mb_strrchr((string)$haystack, (string)$needle, (bool)$before_needle, $encoding); } |
|
82 | 82 | } |
83 | 83 | if (!function_exists('mb_strrichr')) { |
84 | - function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } |
|
84 | + function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string | false { return p\Mbstring::mb_strrichr((string)$haystack, (string)$needle, (bool)$before_needle, $encoding); } |
|
85 | 85 | } |
86 | 86 | if (!function_exists('mb_strripos')) { |
87 | - function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } |
|
87 | + function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int | false { return p\Mbstring::mb_strripos((string)$haystack, (string)$needle, (int)$offset, $encoding); } |
|
88 | 88 | } |
89 | 89 | if (!function_exists('mb_strrpos')) { |
90 | - function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } |
|
90 | + function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int | false { return p\Mbstring::mb_strrpos((string)$haystack, (string)$needle, (int)$offset, $encoding); } |
|
91 | 91 | } |
92 | 92 | if (!function_exists('mb_strstr')) { |
93 | - function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } |
|
93 | + function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string | false { return p\Mbstring::mb_strstr((string)$haystack, (string)$needle, (bool)$before_needle, $encoding); } |
|
94 | 94 | } |
95 | 95 | if (!function_exists('mb_get_info')) { |
96 | - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } |
|
96 | + function mb_get_info(?string $type = 'all'): array | string | int | false { return p\Mbstring::mb_get_info((string)$type); } |
|
97 | 97 | } |
98 | 98 | if (!function_exists('mb_http_output')) { |
99 | - function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } |
|
99 | + function mb_http_output(?string $encoding = null): string | bool { return p\Mbstring::mb_http_output($encoding); } |
|
100 | 100 | } |
101 | 101 | if (!function_exists('mb_strwidth')) { |
102 | - function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } |
|
102 | + function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string)$string, $encoding); } |
|
103 | 103 | } |
104 | 104 | if (!function_exists('mb_substr_count')) { |
105 | - function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } |
|
105 | + function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string)$haystack, (string)$needle, $encoding); } |
|
106 | 106 | } |
107 | 107 | if (!function_exists('mb_output_handler')) { |
108 | - function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } |
|
108 | + function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string)$string, (int)$status); } |
|
109 | 109 | } |
110 | 110 | if (!function_exists('mb_http_input')) { |
111 | - function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } |
|
111 | + function mb_http_input(?string $type = null): array | string | false { return p\Mbstring::mb_http_input($type); } |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | if (!function_exists('mb_convert_variables')) { |
115 | - function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } |
|
115 | + function mb_convert_variables(?string $to_encoding, array | string | null $from_encoding, mixed &$var, mixed &...$vars): string | false { return p\Mbstring::mb_convert_variables((string)$to_encoding, $from_encoding ?? '', $var, ...$vars); } |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | if (!function_exists('mb_ord')) { |
119 | - function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } |
|
119 | + function mb_ord(?string $string, ?string $encoding = null): int | false { return p\Mbstring::mb_ord((string)$string, $encoding); } |
|
120 | 120 | } |
121 | 121 | if (!function_exists('mb_chr')) { |
122 | - function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } |
|
122 | + function mb_chr(?int $codepoint, ?string $encoding = null): string | false { return p\Mbstring::mb_chr((int)$codepoint, $encoding); } |
|
123 | 123 | } |
124 | 124 | if (!function_exists('mb_scrub')) { |
125 | - function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } |
|
125 | + function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string)$string, $encoding, $encoding); } |
|
126 | 126 | } |
127 | 127 | if (!function_exists('mb_str_split')) { |
128 | - function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } |
|
128 | + function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string)$string, (int)$length, $encoding); } |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | if (extension_loaded('mbstring')) { |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | |
45 | 45 | if (\is_array($listener)) { |
46 | 46 | $this->name = \is_object($listener[0]) ? get_debug_type($listener[0]) : $listener[0]; |
47 | - $this->pretty = $this->name.'::'.$listener[1]; |
|
47 | + $this->pretty = $this->name . '::' . $listener[1]; |
|
48 | 48 | } elseif ($listener instanceof \Closure) { |
49 | 49 | $r = new \ReflectionFunction($listener); |
50 | 50 | if (false !== strpos($r->name, '{closure}')) { |
51 | 51 | $this->pretty = $this->name = 'closure'; |
52 | 52 | } elseif ($class = $r->getClosureScopeClass()) { |
53 | 53 | $this->name = $class->name; |
54 | - $this->pretty = $this->name.'::'.$r->name; |
|
54 | + $this->pretty = $this->name . '::' . $r->name; |
|
55 | 55 | } else { |
56 | 56 | $this->pretty = $this->name = $r->name; |
57 | 57 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $this->pretty = $this->name = $listener; |
60 | 60 | } else { |
61 | 61 | $this->name = get_debug_type($listener); |
62 | - $this->pretty = $this->name.'::__invoke'; |
|
62 | + $this->pretty = $this->name . '::__invoke'; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | if (null !== $name) { |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | public function getInfo(string $eventName): array |
95 | 95 | { |
96 | 96 | if (null === $this->stub) { |
97 | - $this->stub = self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->listener) : $this->pretty.'()'; |
|
97 | + $this->stub = self::$hasClassStub ? new ClassStub($this->pretty . '()', $this->listener) : $this->pretty . '()'; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | return [ |
@@ -262,7 +262,7 @@ |
||
262 | 262 | foreach ($listeners as &$listener) { |
263 | 263 | $closure = &$this->optimized[$eventName][]; |
264 | 264 | if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { |
265 | - $closure = static function (...$args) use (&$listener, &$closure) { |
|
265 | + $closure = static function(...$args) use (&$listener, &$closure) { |
|
266 | 266 | if ($listener[0] instanceof \Closure) { |
267 | 267 | $listener[0] = $listener[0](); |
268 | 268 | $listener[1] = $listener[1] ?? '__invoke'; |