Files
kiri-router/src/SwowHttpResponseEmitter.php
T

34 lines
805 B
PHP
Raw Normal View History

2023-04-24 10:54:56 +08:00
<?php
namespace Kiri\Router;
use Kiri\Di\Interface\ResponseEmitterInterface;
2023-08-16 01:01:47 +08:00
use Kiri\Server\Events\OnAfterRequest;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
2023-04-24 10:54:56 +08:00
use Psr\Http\Message\ResponseInterface;
2023-08-16 01:01:47 +08:00
use ReflectionException;
2023-04-24 10:54:56 +08:00
2023-04-24 14:23:24 +08:00
class SwowHttpResponseEmitter implements ResponseEmitterInterface
2023-04-24 10:54:56 +08:00
{
2023-08-16 01:01:47 +08:00
/**
* @param Response $proxy
* @param object $response
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws ReflectionException
*/
2023-04-24 10:54:56 +08:00
public function sender(ResponseInterface $proxy, object $response): void
{
// TODO: Implement sender() method.
$proxy->withHeader('Server', 'Swow');
$response->sendHttpResponse($proxy);
2023-08-16 01:01:47 +08:00
event(new OnAfterRequest());
}
2023-04-24 10:54:56 +08:00
}