mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 00:55:35 +08:00
remove unused trait
This commit is contained in:
@@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace ZM\Context\Trait;
|
|
||||||
|
|
||||||
use OneBot\Driver\Event\Http\HttpRequestEvent;
|
|
||||||
use Psr\Http\Message\ResponseInterface;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
|
||||||
use ZM\Exception\ZMKnownException;
|
|
||||||
|
|
||||||
trait HttpTrait
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
public function getRequest(): ServerRequestInterface
|
|
||||||
{
|
|
||||||
return container()->get('http.request');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
public function getHttpRequestEvent(): HttpRequestEvent
|
|
||||||
{
|
|
||||||
$obj = container()->get('http.request.event');
|
|
||||||
if (!$obj instanceof HttpRequestEvent) {
|
|
||||||
throw new ZMKnownException('E00099', 'current context container event is not HttpRequestEvent');
|
|
||||||
}
|
|
||||||
return $obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function withResponse(ResponseInterface $response)
|
|
||||||
{
|
|
||||||
$this->getHttpRequestEvent()->withResponse($response);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user