Skip to content

Commit bcaa2f1

Browse files
committed
Improve HttpWorkerInterface types
1 parent 5bd06ba commit bcaa2f1

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/HttpWorkerInterface.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?php
22

33
/**
4-
* High-performance PHP process supervisor and load balancer written in Go. Http core.
4+
* This file is part of RoadRunner package.
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
58
*/
69

710
declare(strict_types=1);
@@ -10,6 +13,9 @@
1013

1114
use Spiral\RoadRunner\WorkerAwareInterface;
1215

16+
/**
17+
* @psalm-import-type HeadersList from Request
18+
*/
1319
interface HttpWorkerInterface extends WorkerAwareInterface
1420
{
1521
/**
@@ -22,11 +28,10 @@ public function waitRequest(): ?Request;
2228
/**
2329
* Send response to the application server.
2430
*
25-
* @param int $status Http status code
26-
* @param string $body Body of response
27-
* @param string[][] $headers An associative array of the message's headers. Each
28-
* key MUST be a header name, and each value MUST be an array of strings
29-
* for that header.
31+
* @param int $status Http status code
32+
* @param string $body Body of response
33+
* @param HeadersList|array $headers An associative array of the message's headers. Each key MUST be a header name,
34+
* and each value MUST be an array of strings for that header.
3035
*/
3136
public function respond(int $status, string $body, array $headers = []): void;
3237
}

0 commit comments

Comments
 (0)