This commit is contained in:
2023-08-16 01:01:47 +08:00
parent 6e7e20380f
commit 4461d23e0d
3 changed files with 43 additions and 17 deletions
+13 -4
View File
@@ -4,6 +4,11 @@ declare(strict_types=1);
namespace Kiri\Router;
use Kiri\Server\Events\OnAfterRequest;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use ReflectionException;
/**
*
*/
@@ -13,10 +18,13 @@ class StreamResponse extends Response
public int $limit;
/**
* @param object $response
* @return void
*/
/**
* @param object $response
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
* @throws ReflectionException
*/
public function end(object $response): void
{
$body = $this->getBody();
@@ -28,6 +36,7 @@ class StreamResponse extends Response
$response->write($body->read($this->limit));
}
$response->end();
event(new OnAfterRequest());
}
}