Skip to content

Commit

Permalink
Use consts
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Jul 7, 2024
1 parent c3b1219 commit fba53be
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Debug/Controller/DebugController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Yiisoft\Yii\Debug\Api\Debug\Controller;

use OpenApi\Attributes as OA;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
Expand All @@ -12,6 +13,7 @@
use Yiisoft\Assets\AssetPublisherInterface;
use Yiisoft\DataResponse\DataResponse;
use Yiisoft\DataResponse\DataResponseFactoryInterface;
use Yiisoft\Http\Header;
use Yiisoft\Router\CurrentRoute;
use Yiisoft\Yii\Debug\Api\Debug\Exception\NotFoundException;
use Yiisoft\Yii\Debug\Api\Debug\Exception\PackageNotInstalledException;
Expand All @@ -21,7 +23,6 @@
use Yiisoft\Yii\Debug\Api\ServerSentEventsStream;
use Yiisoft\Yii\Debug\Storage\StorageInterface;
use Yiisoft\Yii\View\ViewRenderer;
use OpenApi\Attributes as OA;

/**
* Debug controller provides endpoints that expose information about requests processed that debugger collected.
Expand Down Expand Up @@ -323,9 +324,9 @@ public function eventStream(
$retries = 0;

return $responseFactory->createResponse()
->withHeader('Content-Type', 'text/event-stream')
->withHeader('Cache-Control', 'no-cache')
->withHeader('Connection', 'keep-alive')
->withHeader(Header::CONTENT_TYPE, 'text/event-stream')
->withHeader(Header::CACHE_CONTROL, 'no-cache')
->withHeader(Header::CONNECTION, 'keep-alive')
->withBody(
new ServerSentEventsStream(function (array &$buffer) use (
$compareFunction,
Expand Down

0 comments on commit fba53be

Please sign in to comment.