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 * @return bool
* @throws Exception * @throws Exception
*/ */
public function addError($message, $model = 'app'): bool public function addError($message, string $model = 'app'): bool
{ {
if ($message instanceof \Throwable) { if ($message instanceof \Throwable) {
$Throwable = $message; $Throwable = $message;
+7 -7
View File
@@ -177,7 +177,7 @@ abstract class Pool extends Component
static::$_items[$name] = $channel; static::$_items[$name] = $channel;
} }
if ($channel->isEmpty()) { if ($channel->isEmpty()) {
$this->createByCallback($channel, $name, $callback); return $this->createClient($name, $callback);
} }
$connection = $channel->pop(); $connection = $channel->pop();
if (!$this->checkCanUse($name, $connection)) { if (!$this->checkCanUse($name, $connection)) {
@@ -189,7 +189,7 @@ abstract class Pool extends Component
/** /**
* @param $channel * @param Channel $channel
* @param $name * @param $name
* @param mixed $callback * @param mixed $callback
*/ */
@@ -211,7 +211,7 @@ abstract class Pool extends Component
* @param false $isMaster * @param false $isMaster
* @return string * @return string
*/ */
#[Pure] public function name($driver, $cds, $isMaster = false): string #[Pure] public function name($driver, $cds, bool $isMaster = false): string
{ {
if ($isMaster === true) { if ($isMaster === true) {
return $cds . '_master'; return $cds . '_master';
@@ -259,7 +259,7 @@ abstract class Pool extends Component
/** /**
* @param $name * @param string $name
* @return bool * @return bool
*/ */
public function hasItem(string $name): bool public function hasItem(string $name): bool
@@ -272,7 +272,7 @@ abstract class Pool extends Component
/** /**
* @param $name * @param string $name
* @return mixed * @return mixed
*/ */
public function size(string $name): mixed public function size(string $name): mixed
@@ -288,8 +288,8 @@ abstract class Pool extends Component
/** /**
* @param $name * @param string $name
* @param $client * @param mixed $client
*/ */
public function push(string $name, mixed $client) public function push(string $name, mixed $client)
{ {
+8 -8
View File
@@ -96,7 +96,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
} }
/** /**
* @param $timeout * @param int $timeout
*/ */
public function setTimeout(int $timeout) public function setTimeout(int $timeout)
{ {
@@ -104,7 +104,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
} }
/** /**
* @param $timeout * @param string $timeout
*/ */
public function setKey(string $timeout) public function setKey(string $timeout)
{ {
@@ -127,7 +127,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
* @return array * @return array
* @throws Exception * @throws Exception
*/ */
public function create(int $unionId, $headers = []): array public function create(int $unionId, array $headers = []): array
{ {
$this->user = $unionId; $this->user = $unionId;
$this->config['time'] = time(); $this->config['time'] = time();
@@ -181,7 +181,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
* @return array * @return array
* @throws * @throws
*/ */
private function assembly(array $param, $update = FALSE): array private function assembly(array $param, bool $update = FALSE): array
{ {
if (isset($param['sign'])) { if (isset($param['sign'])) {
unset($param['sign']); unset($param['sign']);
@@ -204,7 +204,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
* @return array * @return array
* @throws Exception * @throws Exception
*/ */
public function refresh($headers = []): array public function refresh(array $headers = []): array
{ {
$this->data = $headers; $this->data = $headers;
if (!openssl_public_decrypt(base64_decode($headers['refresh']), $data, $this->public)) { if (!openssl_public_decrypt(base64_decode($headers['refresh']), $data, $this->public)) {
@@ -223,7 +223,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
} }
/** /**
* @param $param * @param array $param
* *
* @return array * @return array
*/ */
@@ -292,7 +292,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
* *
* @return string * @return string
*/ */
private function token(int $user, $param = [], $requestTime = NULL): string private function token(int $user, array $param = [], $requestTime = NULL): string
{ {
$str = ''; $str = '';
@@ -349,7 +349,7 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
* @param array $data * @param array $data
* @param int $user * @param int $user
* @return bool * @return bool
* @throws AuthException * @throws AuthException|Exception
*/ */
public function check(array $data, int $user): bool public function check(array $data, int $user): bool
{ {