@@ -12,7 +12,7 @@ discard block |
||
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 | 18 | function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } |
@@ -30,10 +30,10 @@ discard block |
||
30 | 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(); } |
@@ -42,13 +42,13 @@ discard block |
||
42 | 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 | 54 | function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 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 | 63 | function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } |
@@ -66,37 +66,37 @@ discard block |
||
66 | 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 | 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|null { return p\Mbstring::mb_get_info((string) $type); } |
|
96 | + function mb_get_info(?string $type = 'all'): array | string | int | false | null { 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 | 102 | function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } |
@@ -108,18 +108,18 @@ discard block |
||
108 | 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 | 125 | function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } |
@@ -51,14 +51,14 @@ |
||
51 | 51 | |
52 | 52 | /* @var SubscribedService $attribute */ |
53 | 53 | $attribute = $attribute->newInstance(); |
54 | - $attribute->key ??= self::class.'::'.$method->name; |
|
54 | + $attribute->key ??= self::class . '::' . $method->name; |
|
55 | 55 | $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; |
56 | 56 | $attribute->nullable = $returnType->allowsNull(); |
57 | 57 | |
58 | 58 | if ($attribute->attributes) { |
59 | 59 | $services[] = $attribute; |
60 | 60 | } else { |
61 | - $services[$attribute->key] = ($attribute->nullable ? '?' : '').$attribute->type; |
|
61 | + $services[$attribute->key] = ($attribute->nullable ? '?' : '') . $attribute->type; |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | foreach ($paths as $path) { |
60 | 60 | if (preg_match('/\.php$/i', $path)) { |
61 | 61 | // Prevent variable leak into deploy.php file |
62 | - call_user_func(function () use ($path) { |
|
62 | + call_user_func(function() use ($path) { |
|
63 | 63 | // Reorder autoload stack |
64 | 64 | $originStack = spl_autoload_functions(); |
65 | 65 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } elseif (preg_match('/\.ya?ml$/i', $path)) { |
77 | 77 | self::$recipeFilename = basename($path); |
78 | 78 | self::$recipeSource = file_get_contents($path, true); |
79 | - $root = array_filter(Yaml::parse(self::$recipeSource), static function (string $key) { |
|
79 | + $root = array_filter(Yaml::parse(self::$recipeSource), static function(string $key) { |
|
80 | 80 | return substr($key, 0, 1) !== '.'; |
81 | 81 | }, ARRAY_FILTER_USE_KEY); |
82 | 82 | |
@@ -131,17 +131,17 @@ discard block |
||
131 | 131 | |
132 | 132 | protected static function tasks(array $tasks) |
133 | 133 | { |
134 | - $buildTask = function ($name, $steps) { |
|
135 | - $body = function () {}; |
|
134 | + $buildTask = function($name, $steps) { |
|
135 | + $body = function() {}; |
|
136 | 136 | $task = task($name, $body); |
137 | 137 | |
138 | 138 | foreach ($steps as $step) { |
139 | - $buildStep = function ($step) use (&$body, $task) { |
|
139 | + $buildStep = function($step) use (&$body, $task) { |
|
140 | 140 | extract($step); |
141 | 141 | |
142 | 142 | if (isset($cd)) { |
143 | 143 | $prev = $body; |
144 | - $body = function () use ($cd, $prev) { |
|
144 | + $body = function() use ($cd, $prev) { |
|
145 | 145 | $prev(); |
146 | 146 | cd($cd); |
147 | 147 | }; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | if (isset($run)) { |
151 | 151 | $has = 'run'; |
152 | 152 | $prev = $body; |
153 | - $body = function () use ($run, $prev) { |
|
153 | + $body = function() use ($run, $prev) { |
|
154 | 154 | $prev(); |
155 | 155 | try { |
156 | 156 | run($run); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | $has = 'run_locally'; |
170 | 170 | $prev = $body; |
171 | - $body = function () use ($run_locally, $prev) { |
|
171 | + $body = function() use ($run_locally, $prev) { |
|
172 | 172 | $prev(); |
173 | 173 | try { |
174 | 174 | runLocally($run_locally); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | $has = 'upload'; |
188 | 188 | $prev = $body; |
189 | - $body = function () use ($upload, $prev) { |
|
189 | + $body = function() use ($upload, $prev) { |
|
190 | 190 | $prev(); |
191 | 191 | upload($upload['src'], $upload['dest']); |
192 | 192 | }; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | $has = 'download'; |
200 | 200 | $prev = $body; |
201 | - $body = function () use ($download, $prev) { |
|
201 | + $body = function() use ($download, $prev) { |
|
202 | 202 | $prev(); |
203 | 203 | download($download['src'], $download['dest']); |
204 | 204 | }; |
@@ -120,7 +120,7 @@ |
||
120 | 120 | |
121 | 121 | usort( |
122 | 122 | $updates, |
123 | - function (Update $a, Update $b) { |
|
123 | + function(Update $a, Update $b) { |
|
124 | 124 | return Comparator::isGreaterThan( |
125 | 125 | $a->getVersion(), |
126 | 126 | $b->getVersion(), |
@@ -88,7 +88,7 @@ |
||
88 | 88 | ->setTimeout((null === $config['timeout']) ? null : (float) $config['timeout']) |
89 | 89 | ->setIdleTimeout((null === $config['idle_timeout']) ? null : (float) $config['idle_timeout']); |
90 | 90 | |
91 | - $callback = function ($type, $buffer) use ($config, $host) { |
|
91 | + $callback = function($type, $buffer) use ($config, $host) { |
|
92 | 92 | $this->logger->printBuffer($host, $type, $buffer); |
93 | 93 | $this->pop->callback($host, boolval($config['real_time_output']))($type, $buffer); |
94 | 94 | }; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $dealersHand = []; |
81 | 81 | $playersHand = []; |
82 | 82 | shuffle($deck); |
83 | - $deal = function () use (&$deck, &$graveyard) { |
|
83 | + $deal = function() use (&$deck, &$graveyard) { |
|
84 | 84 | if (count($deck) == 0) { |
85 | 85 | shuffle($graveyard); |
86 | 86 | $deck = $graveyard; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | } |
288 | 288 | $variants = [$value]; |
289 | 289 | while ($aces-- > 0) { |
290 | - $variants = array_flatten(array_map(function ($v) { |
|
290 | + $variants = array_flatten(array_map(function($v) { |
|
291 | 291 | return [$v + 1, $v + 11]; |
292 | 292 | }, $variants)); |
293 | 293 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | function array_flatten(array $array) |
20 | 20 | { |
21 | 21 | $flatten = []; |
22 | - array_walk_recursive($array, function ($value) use (&$flatten) { |
|
22 | + array_walk_recursive($array, function($value) use (&$flatten) { |
|
23 | 23 | $flatten[] = $value; |
24 | 24 | }); |
25 | 25 | return $flatten; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | function env_stringify(array $array): string |
89 | 89 | { |
90 | 90 | return implode(' ', array_map( |
91 | - function ($key, $value) { |
|
91 | + function($key, $value) { |
|
92 | 92 | return sprintf("%s=%s", $key, escapeshellarg((string) $value)); |
93 | 93 | }, |
94 | 94 | array_keys($array), |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | |
181 | 181 | if (getenv('COLORTERM') === 'truecolor') { |
182 | - $hsv = function ($h, $s, $v) { |
|
182 | + $hsv = function($h, $s, $v) { |
|
183 | 183 | $r = $g = $b = $i = $f = $p = $q = $t = 0; |
184 | 184 | $i = floor($h * 6); |
185 | 185 | $f = $h * 6 - $i; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $labels = $host->get('labels', []); |
54 | 54 | $labels['alias'] = $host->getAlias(); |
55 | 55 | $labels['true'] = 'true'; |
56 | - $isTrue = function ($value) { |
|
56 | + $isTrue = function($value) { |
|
57 | 57 | return $value; |
58 | 58 | }; |
59 | 59 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | private static function compare(string $op, $a, ?string $b): bool |
76 | 76 | { |
77 | - $matchFunction = function ($a, ?string $b) { |
|
77 | + $matchFunction = function($a, ?string $b) { |
|
78 | 78 | foreach ((array) $a as $item) { |
79 | 79 | if ($item === $b) { |
80 | 80 | return true; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $this->loop, |
60 | 60 | new React\Http\Middleware\StreamingRequestMiddleware(), |
61 | 61 | new React\Http\Middleware\RequestBodyBufferMiddleware(16 * 1024 * 1024), // 16 MiB |
62 | - function (ServerRequestInterface $request) { |
|
62 | + function(ServerRequestInterface $request) { |
|
63 | 63 | try { |
64 | 64 | return $this->router($request); |
65 | 65 | } catch (Throwable $exception) { |