This commit is contained in:
2023-12-13 19:19:18 +08:00
parent 85ceb901bd
commit d0241e987f
+11 -15
View File
@@ -12,8 +12,6 @@ use Kiri\Events\EventDispatch;
use Kiri\Events\EventProvider; use Kiri\Events\EventProvider;
use Kiri\Router\Request; use Kiri\Router\Request;
use Kiri\Router\Response; use Kiri\Router\Response;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\RequestInterface; use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Swoole\Process; use Swoole\Process;
@@ -34,7 +32,7 @@ if (!function_exists('application')) {
/** /**
* @return Application * @return Application
* @throws Exception * @throws
*/ */
function application(): Application function application(): Application
{ {
@@ -102,7 +100,7 @@ if (!function_exists('call')) {
* @param $handler * @param $handler
* @param mixed ...$params * @param mixed ...$params
* @return mixed * @return mixed
* @throws Exception * @throws
*/ */
function call($handler, ...$params): mixed function call($handler, ...$params): mixed
{ {
@@ -123,7 +121,7 @@ if (!function_exists('checkPortIsAlready')) {
/** /**
* @param $port * @param $port
* @return bool|string * @return bool|string
* @throws Exception * @throws
*/ */
function checkPortIsAlready($port): bool|string function checkPortIsAlready($port): bool|string
{ {
@@ -277,7 +275,7 @@ if (!function_exists('inject')) {
/** /**
* @param object $object * @param object $object
* @return object * @return object
* @throws ReflectionException * @throws
*/ */
function inject(object $object): object function inject(object $object): object
{ {
@@ -311,7 +309,7 @@ if (!function_exists('redis')) {
/** /**
* @return \Kiri\Redis\Redis|Redis * @return \Kiri\Redis\Redis|Redis
* @throws Exception * @throws
*/ */
function redis(): \Kiri\Redis\Redis|Redis function redis(): \Kiri\Redis\Redis|Redis
{ {
@@ -324,9 +322,7 @@ if (!function_exists('fire')) {
/** /**
* @param object $event * @param object $event
* @throws ContainerExceptionInterface * @throws
* @throws NotFoundExceptionInterface
* @throws ReflectionException
*/ */
function fire(object $event): void function fire(object $event): void
{ {
@@ -619,7 +615,7 @@ if (!function_exists('storage')) {
* @param string|null $fileName * @param string|null $fileName
* @param string|null $path * @param string|null $path
* @return string * @return string
* @throws Exception * @throws
*/ */
function storage(?string $fileName = '', ?string $path = ''): string function storage(?string $fileName = '', ?string $path = ''): string
{ {
@@ -683,7 +679,7 @@ if (!function_exists('process_name_set')) {
/** /**
* @param int $pid * @param int $pid
* @param string|null $prefix * @param string|null $prefix
* @throws Exception * @throws
*/ */
function process_name_set(int $pid, string $prefix = NULL): void function process_name_set(int $pid, string $prefix = NULL): void
{ {
@@ -756,7 +752,7 @@ if (!function_exists('created')) {
* @param array $construct * @param array $construct
* @param array $config * @param array $config
* @return null|object * @return null|object
* @throws ReflectionException * @throws
*/ */
function created($key, array $construct = [], array $config = []): ?object function created($key, array $construct = [], array $config = []): ?object
{ {
@@ -772,7 +768,7 @@ if (!function_exists('di')) {
/** /**
* @param string|object $className * @param string|object $className
* @return mixed * @return mixed
* @throws ReflectionException * @throws
*/ */
function di(string|object $className): mixed function di(string|object $className): mixed
{ {
@@ -915,7 +911,7 @@ if (!function_exists('event')) {
/** /**
* @param object $object * @param object $object
* @return void * @return void
* @throws ReflectionException|Exception * @throws
*/ */
function event(object $object): void function event(object $object): void
{ {