This commit is contained in:
2021-06-29 10:57:39 +08:00
parent a70e080153
commit e4c65484fe
3 changed files with 24 additions and 24 deletions
+1 -1
View File
@@ -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;
+7 -7
View File
@@ -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)
{
+16 -16
View File
@@ -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
{