mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
fix the rest problem code to phpstan-level-1
This commit is contained in:
parent
d490892092
commit
daa1822bc5
@ -1,6 +1,6 @@
|
||||
parameters:
|
||||
reportUnmatchedIgnoredErrors: false
|
||||
level: 0
|
||||
level: 1
|
||||
paths:
|
||||
- ./src/
|
||||
ignoreErrors:
|
||||
|
||||
@ -44,7 +44,7 @@ class UpdateBody
|
||||
$msg[] = $k . ' = ?';
|
||||
$arr[] = $v;
|
||||
}
|
||||
if (($msg ?? []) == []) {
|
||||
if ($msg == []) {
|
||||
throw new DbException('update value sets can not be empty!');
|
||||
}
|
||||
$line = 'UPDATE ' . $this->table->getTableName() . ' SET ' . implode(', ', $msg);
|
||||
|
||||
@ -14,10 +14,9 @@ use ZM\Utils\Manager\WorkerManager;
|
||||
class CoMessage
|
||||
{
|
||||
/**
|
||||
* @param int $timeout
|
||||
* @return mixed
|
||||
*/
|
||||
public static function yieldByWS(array $hang, array $compare, $timeout = 600)
|
||||
public static function yieldByWS(array $hang, array $compare, int $timeout = 600)
|
||||
{
|
||||
$cid = Coroutine::getuid();
|
||||
$api_id = ZMAtomic::get('wait_msg_id')->add(1);
|
||||
@ -43,9 +42,7 @@ class CoMessage
|
||||
unset($sess[$api_id]);
|
||||
LightCacheInside::set('wait_api', 'wait_api', $sess);
|
||||
SpinLock::unlock('wait_api');
|
||||
if (isset($id)) {
|
||||
swoole_timer_clear($id);
|
||||
}
|
||||
swoole_timer_clear($id);
|
||||
if ($result === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -22,12 +22,13 @@ class MessageUtil
|
||||
/**
|
||||
* 下载消息中 CQ 码的所有图片,通过 url
|
||||
* @param $msg
|
||||
* @param null $path
|
||||
* @return array|false
|
||||
*/
|
||||
public static function downloadCQImage($msg, $path = null)
|
||||
public static function downloadCQImage($msg, ?string $path = null)
|
||||
{
|
||||
$path = $path ?? DataProvider::getDataFolder() . 'images/';
|
||||
if ($path === null) {
|
||||
$path = DataProvider::getDataFolder() . 'images/';
|
||||
}
|
||||
if (!is_dir($path)) {
|
||||
@mkdir($path);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user