mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
remove deprecated Context class
This commit is contained in:
parent
fe6c11b8af
commit
b33f67bb27
@ -1,11 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace PHPSTORM_META {
|
|
||||||
|
|
||||||
use OneBot\V12\Object\Event\OneBotEvent;
|
|
||||||
use ZM\Context\Context;
|
|
||||||
|
|
||||||
override(Context::__call(0), map([
|
|
||||||
'getBotEvent' => OneBotEvent::class,
|
|
||||||
]));
|
|
||||||
}
|
|
||||||
@ -54,9 +54,6 @@ $config['runtime'] = [
|
|||||||
'timezone' => 'Asia/Shanghai',
|
'timezone' => 'Asia/Shanghai',
|
||||||
];
|
];
|
||||||
|
|
||||||
/* 上下文接口类 implemented from ContextInterface */
|
|
||||||
$config['context_class'] = \ZM\Context\Context::class;
|
|
||||||
|
|
||||||
/* 允许加载插件形式 */
|
/* 允许加载插件形式 */
|
||||||
$config['plugin'] = [
|
$config['plugin'] = [
|
||||||
'enable' => true,
|
'enable' => true,
|
||||||
|
|||||||
@ -13,8 +13,6 @@ use OneBot\V12\Object\ActionResponse;
|
|||||||
use OneBot\V12\Object\OneBotEvent;
|
use OneBot\V12\Object\OneBotEvent;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use ZM\Context\BotContext;
|
use ZM\Context\BotContext;
|
||||||
use ZM\Context\Context;
|
|
||||||
use ZM\Context\ContextInterface;
|
|
||||||
|
|
||||||
class ContainerRegistrant
|
class ContainerRegistrant
|
||||||
{
|
{
|
||||||
@ -59,7 +57,6 @@ class ContainerRegistrant
|
|||||||
'http.request.event' => DI\get(HttpRequestEvent::class),
|
'http.request.event' => DI\get(HttpRequestEvent::class),
|
||||||
ServerRequestInterface::class => fn () => $event->getRequest(),
|
ServerRequestInterface::class => fn () => $event->getRequest(),
|
||||||
'http.request' => DI\get(ServerRequestInterface::class),
|
'http.request' => DI\get(ServerRequestInterface::class),
|
||||||
ContextInterface::class => Context::class,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace ZM\Context;
|
|
||||||
|
|
||||||
use ZM\Context\Trait\HttpTrait;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下面是机器人类的方法
|
|
||||||
* @method reply($message) 快速回复消息
|
|
||||||
* @method action(string $action, array $params = []) 执行动作
|
|
||||||
* @method getArgument(string $name) 获取BotCommand的参数
|
|
||||||
* @method getRawArguments() 获取裸的参数
|
|
||||||
* @method getBotEvent(bool $array = false) 获取事件原对象
|
|
||||||
* @method getBotSelf() 获取机器人自身的信息
|
|
||||||
*/
|
|
||||||
class Context implements ContextInterface
|
|
||||||
{
|
|
||||||
use HttpTrait;
|
|
||||||
|
|
||||||
// TODO:完善上下文的方法们
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user