改名
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
+16
-16
@@ -95,17 +95,17 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
|
|||||||
$this->public = $publicKey;
|
$this->public = $publicKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $timeout
|
* @param int $timeout
|
||||||
*/
|
*/
|
||||||
public function setTimeout(int $timeout)
|
public function setTimeout(int $timeout)
|
||||||
{
|
{
|
||||||
$this->timeout = $timeout;
|
$this->timeout = $timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $timeout
|
* @param string $timeout
|
||||||
*/
|
*/
|
||||||
public function setKey(string $timeout)
|
public function setKey(string $timeout)
|
||||||
{
|
{
|
||||||
$this->key = $timeout;
|
$this->key = $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)) {
|
||||||
@@ -222,11 +222,11 @@ mlAZUEjsoaT9vjvjGTxl3uCm0TX5KTgtSJIt2kA1tYVjQef+/iZTHxY=
|
|||||||
return $this->create($this->user, $headers);
|
return $this->create($this->user, $headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $param
|
* @param array $param
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function initialize(array $param): array
|
private function initialize(array $param): array
|
||||||
{
|
{
|
||||||
$_param = [
|
$_param = [
|
||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user