diff --git a/System/Abstracts/BaseObject.php b/System/Abstracts/BaseObject.php index 8da6c0a1..ef746fc1 100644 --- a/System/Abstracts/BaseObject.php +++ b/System/Abstracts/BaseObject.php @@ -104,7 +104,7 @@ class BaseObject implements Configure * @return bool * @throws Exception */ - public function addError($message, $model = 'app'): bool + public function addError($message, string $model = 'app'): bool { if ($message instanceof \Throwable) { $Throwable = $message; diff --git a/System/Abstracts/Pool.php b/System/Abstracts/Pool.php index 855ff96c..83e9db19 100644 --- a/System/Abstracts/Pool.php +++ b/System/Abstracts/Pool.php @@ -177,7 +177,7 @@ abstract class Pool extends Component static::$_items[$name] = $channel; } if ($channel->isEmpty()) { - $this->createByCallback($channel, $name, $callback); + return $this->createClient($name, $callback); } $connection = $channel->pop(); if (!$this->checkCanUse($name, $connection)) { @@ -189,7 +189,7 @@ abstract class Pool extends Component /** - * @param $channel + * @param Channel $channel * @param $name * @param mixed $callback */ @@ -211,7 +211,7 @@ abstract class Pool extends Component * @param false $isMaster * @return string */ - #[Pure] public function name($driver, $cds, $isMaster = false): string + #[Pure] public function name($driver, $cds, bool $isMaster = false): string { if ($isMaster === true) { return $cds . '_master'; @@ -259,7 +259,7 @@ abstract class Pool extends Component /** - * @param $name + * @param string $name * @return bool */ public function hasItem(string $name): bool @@ -272,7 +272,7 @@ abstract class Pool extends Component /** - * @param $name + * @param string $name * @return mixed */ public function size(string $name): mixed @@ -288,8 +288,8 @@ abstract class Pool extends Component /** - * @param $name - * @param $client + * @param string $name + * @param mixed $client */ public function push(string $name, mixed $client) { diff --git a/System/Jwt/Jwt.php b/System/Jwt/Jwt.php index 9d4b7ac8..a9ebae58 100644 --- a/System/Jwt/Jwt.php +++ b/System/Jwt/Jwt.php @@ -95,17 +95,17 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= $this->public = $publicKey; } - /** - * @param $timeout - */ + /** + * @param int $timeout + */ public function setTimeout(int $timeout) { $this->timeout = $timeout; } - /** - * @param $timeout - */ + /** + * @param string $timeout + */ public function setKey(string $timeout) { $this->key = $timeout; @@ -127,7 +127,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= * @return array * @throws Exception */ - public function create(int $unionId, $headers = []): array + public function create(int $unionId, array $headers = []): array { $this->user = $unionId; $this->config['time'] = time(); @@ -181,7 +181,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= * @return array * @throws */ - private function assembly(array $param, $update = FALSE): array + private function assembly(array $param, bool $update = FALSE): array { if (isset($param['sign'])) { unset($param['sign']); @@ -204,7 +204,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= * @return array * @throws Exception */ - public function refresh($headers = []): array + public function refresh(array $headers = []): array { $this->data = $headers; if (!openssl_public_decrypt(base64_decode($headers['refresh']), $data, $this->public)) { @@ -222,11 +222,11 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= return $this->create($this->user, $headers); } - /** - * @param $param - * - * @return array - */ + /** + * @param array $param + * + * @return array + */ private function initialize(array $param): array { $_param = [ @@ -292,7 +292,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= * * @return string */ - private function token(int $user, $param = [], $requestTime = NULL): string + private function token(int $user, array $param = [], $requestTime = NULL): string { $str = ''; @@ -349,7 +349,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY= * @param array $data * @param int $user * @return bool - * @throws AuthException + * @throws AuthException|Exception */ public function check(array $data, int $user): bool {