mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 07:35:34 +08:00
let getDriver() method always work
This commit is contained in:
@@ -51,8 +51,8 @@ class Framework
|
||||
/** @var array 传入的参数 */
|
||||
protected array $argv;
|
||||
|
||||
/** @var Driver|SwooleDriver|WorkermanDriver OneBot驱动 */
|
||||
protected SwooleDriver|Driver|WorkermanDriver $driver;
|
||||
/** @var null|Driver|SwooleDriver|WorkermanDriver OneBot驱动 */
|
||||
protected SwooleDriver|Driver|WorkermanDriver|null $driver = null;
|
||||
|
||||
/** @var array<array<string, string>> 启动注解列表 */
|
||||
protected array $setup_annotations = [];
|
||||
@@ -178,6 +178,9 @@ class Framework
|
||||
*/
|
||||
public function getDriver(): Driver
|
||||
{
|
||||
if ($this->driver === null) {
|
||||
$this->driver = new WorkermanDriver();
|
||||
}
|
||||
return $this->driver;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user