Skip to content

Commit

Permalink
Remove deprecated codes (#5812)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdijia authored Jun 7, 2023
1 parent f6ae4dd commit 60d168c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
"require": {
"php": ">=8.1",
"hyperf/collection": "~3.1.0",
"hyperf/config": "~3.1.0",
"hyperf/contract": "~3.1.0",
"hyperf/coroutine": "~3.1.0",
"hyperf/stringable": "~3.1.0",
"hyperf/support": "~3.1.0",
"hyperf/tappable": "~3.1.0"
"hyperf/tappable": "~3.1.0",
"hyperf/translation": "~3.1.0"
},
"autoload": {
"files": [
Expand Down
31 changes: 31 additions & 0 deletions src/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,34 @@ function wait(Closure $closure, ?float $timeout = null)
return \Hyperf\Coroutine\wait($closure, $timeout);
}
}

if (! function_exists('__')) {
function __(string $key, array $replace = [], ?string $locale = null)
{
return \Hyperf\Translation\__($key, $replace, $locale);
}
}

if (! function_exists('trans')) {
function trans(string $key, array $replace = [], ?string $locale = null)
{
return \Hyperf\Translation\__($key, $replace, $locale);
}
}

if (! function_exists('trans_choice')) {
function trans_choice(string $key, $number, array $replace = [], ?string $locale = null): string
{
return \Hyperf\Translation\trans_choice($key, $number, $replace, $locale);
}
}

if (! function_exists('config')) {
/**
* @param null|mixed $default
*/
function config(string $key, $default = null)
{
return \Hyperf\Config\config($key, $default);
}
}

0 comments on commit 60d168c

Please sign in to comment.