PHP80 小修 (#187)

* migrate-php80

fix styles
fix static analyse

* fix some bugs
This commit is contained in:
sunxyw
2022-12-19 20:22:47 +08:00
committed by GitHub
parent da516b487d
commit 8ff7da4d23
46 changed files with 180 additions and 366 deletions

View File

@@ -30,6 +30,7 @@ use ZM\Exception\SingletonViolationException;
use ZM\Exception\ZMKnownException;
use ZM\Logger\TablePrinter;
use ZM\Process\ProcessStateManager;
use ZM\Store\FileSystem;
use ZM\Utils\EasterEgg;
/**
@@ -173,10 +174,8 @@ class Framework
/**
* 获取驱动
*
* @return Driver|SwooleDriver|WorkermanDriver
*/
public function getDriver()
public function getDriver(): Driver
{
return $this->driver;
}
@@ -242,7 +241,7 @@ class Framework
// 框架多进程依赖
if (defined('ZM_STATE_DIR') && !is_dir(ZM_STATE_DIR)) {
mkdir(ZM_STATE_DIR);
FileSystem::createDir(ZM_STATE_DIR);
}
}
@@ -408,7 +407,7 @@ class Framework
logger()->emergency('代码解析错误!');
exit(1);
}
$json = json_decode($r, true);
$json = json_decode($r, true, 512, JSON_THROW_ON_ERROR);
if (!is_array($json)) {
logger()->error(zm_internal_errcode('E00012') . '解析 @OnSetup 时发生错误,请检查代码!');
return;