Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
Rename method. Add missing return type hint.
Browse files Browse the repository at this point in the history
  • Loading branch information
supersmile2009 committed Jul 30, 2020
1 parent 37b0b73 commit c189d77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(
$this->contextManager = $contextManager;
}

public function onKernelResponse(ResponseEvent $event)
public function onKernelResponse(ResponseEvent $event): void
{
if (!$event->isMasterRequest()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ final class SwooleRequestResponseContextManager
private const REQUEST_ATTR_KEY = 'swoole_request';
private const RESPONSE_ATTR_KEY = 'swoole_response';

public function withRequestResponseAttributes(
public function attachRequestResponseAttributes(
HttpFoundationRequest $request,
SwooleRequest $swooleRequest,
SwooleResponse $swooleResponse
) {
): void {
$request->attributes->set(static::REQUEST_ATTR_KEY, $swooleRequest);
$request->attributes->set(static::RESPONSE_ATTR_KEY, $swooleResponse);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bridge/Symfony/HttpKernel/HttpKernelRequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function boot(array $runtimeConfiguration = []): void
public function handle(SwooleRequest $request, SwooleResponse $response): void
{
$httpFoundationRequest = $this->requestFactory->make($request);
$this->contextManager->withRequestResponseAttributes($httpFoundationRequest, $request, $response);
$this->contextManager->attachRequestResponseAttributes($httpFoundationRequest, $request, $response);
$httpFoundationResponse = $this->kernel->handle($httpFoundationRequest);
if (!$httpFoundationResponse instanceof StreamedResponse) {
$this->responseProcessor->process($httpFoundationResponse, $response);
Expand Down

0 comments on commit c189d77

Please sign in to comment.