@@ -58,11 +58,11 @@ discard block |
||
| 58 | 58 | $this->pending[$key] = $promise; |
| 59 | 59 | $this->counts[$key] = 1; |
| 60 | 60 | |
| 61 | - $pending =& $this->pending; |
|
| 62 | - $counts =& $this->counts; |
|
| 63 | - $promise->then(function () use ($key, &$pending, &$counts) { |
|
| 61 | + $pending = & $this->pending; |
|
| 62 | + $counts = & $this->counts; |
|
| 63 | + $promise->then(function() use ($key, &$pending, &$counts) { |
|
| 64 | 64 | unset($pending[$key], $counts[$key]); |
| 65 | - }, function () use ($key, &$pending, &$counts) { |
|
| 65 | + }, function() use ($key, &$pending, &$counts) { |
|
| 66 | 66 | unset($pending[$key], $counts[$key]); |
| 67 | 67 | }); |
| 68 | 68 | } |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | // Return a child promise awaiting the pending query. |
| 71 | 71 | // Cancelling this child promise should only cancel the pending query |
| 72 | 72 | // when no other child promise is awaiting the same query. |
| 73 | - $pending =& $this->pending; |
|
| 74 | - $counts =& $this->counts; |
|
| 75 | - return new Promise(function ($resolve, $reject) use ($promise) { |
|
| 73 | + $pending = & $this->pending; |
|
| 74 | + $counts = & $this->counts; |
|
| 75 | + return new Promise(function($resolve, $reject) use ($promise) { |
|
| 76 | 76 | $promise->then($resolve, $reject); |
| 77 | - }, function () use (&$promise, $key, $query, &$pending, &$counts) { |
|
| 77 | + }, function() use (&$promise, $key, $query, &$pending, &$counts) { |
|
| 78 | 78 | if (--$counts[$key] < 1) { |
| 79 | 79 | unset($pending[$key], $counts[$key]); |
| 80 | 80 | $promise->cancel(); |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!\function_exists('React\Promise\resolve')) { |
| 4 | - require __DIR__.'/functions.php'; |
|
| 4 | + require __DIR__ . '/functions.php'; |
|
| 5 | 5 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | use Symfony\Polyfill\Ctype 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('ctype_alnum')) { |
@@ -220,7 +220,7 @@ |
||
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (\PHP_VERSION_ID >= 80100) { |
| 223 | - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); |
|
| 223 | + @trigger_error($function . '(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | if ($int < 0) { |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; } |
| 20 | 20 | } |
| 21 | 21 | if (!function_exists('hrtime')) { |
| 22 | - require_once __DIR__.'/Php73.php'; |
|
| 22 | + require_once __DIR__ . '/Php73.php'; |
|
| 23 | 23 | p\Php73::$startAt = (int) microtime(true); |
| 24 | 24 | function hrtime($as_number = false) { return p\Php73::hrtime($as_number); } |
| 25 | 25 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | return $class; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; |
|
| 57 | + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class') . '@anonymous'; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public static function get_resource_id($res): int |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | if (\PHP_VERSION_ID >= 80000) { |
| 19 | - return require __DIR__.'/bootstrap80.php'; |
|
| 19 | + return require __DIR__ . '/bootstrap80.php'; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | if (!defined('GRAPHEME_EXTR_COUNT')) { |
@@ -22,29 +22,29 @@ |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | if (!function_exists('grapheme_extract')) { |
| 25 | - function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); } |
|
| 25 | + function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string | false { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); } |
|
| 26 | 26 | } |
| 27 | 27 | if (!function_exists('grapheme_stripos')) { |
| 28 | - function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); } |
|
| 28 | + function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int | false { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); } |
|
| 29 | 29 | } |
| 30 | 30 | if (!function_exists('grapheme_stristr')) { |
| 31 | - function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } |
|
| 31 | + function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string | false { return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } |
|
| 32 | 32 | } |
| 33 | 33 | if (!function_exists('grapheme_strlen')) { |
| 34 | - function grapheme_strlen(?string $string): int|false|null { return p\Grapheme::grapheme_strlen((string) $string); } |
|
| 34 | + function grapheme_strlen(?string $string): int | false | null { return p\Grapheme::grapheme_strlen((string) $string); } |
|
| 35 | 35 | } |
| 36 | 36 | if (!function_exists('grapheme_strpos')) { |
| 37 | - function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); } |
|
| 37 | + function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0): int | false { return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); } |
|
| 38 | 38 | } |
| 39 | 39 | if (!function_exists('grapheme_strripos')) { |
| 40 | - function grapheme_strripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); } |
|
| 40 | + function grapheme_strripos(?string $haystack, ?string $needle, ?int $offset = 0): int | false { return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); } |
|
| 41 | 41 | } |
| 42 | 42 | if (!function_exists('grapheme_strrpos')) { |
| 43 | - function grapheme_strrpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); } |
|
| 43 | + function grapheme_strrpos(?string $haystack, ?string $needle, ?int $offset = 0): int | false { return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); } |
|
| 44 | 44 | } |
| 45 | 45 | if (!function_exists('grapheme_strstr')) { |
| 46 | - function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } |
|
| 46 | + function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string | false { return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } |
|
| 47 | 47 | } |
| 48 | 48 | if (!function_exists('grapheme_substr')) { |
| 49 | - function grapheme_substr(?string $string, ?int $offset, ?int $length = null): string|false { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); } |
|
| 49 | + function grapheme_substr(?string $string, ?int $offset, ?int $length = null): string | false { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); } |
|
| 50 | 50 | } |
@@ -141,7 +141,7 @@ |
||
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - return [$singular.'s']; |
|
| 144 | + return [$singular . 's']; |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | private function isInflectedWord(string $word): bool |