|
14 | 14 |
|
15 | 15 | namespace Elastic\Elasticsearch\Traits; |
16 | 16 |
|
| 17 | +use Psr\Http\Message\MessageInterface; |
| 18 | +use Psr\Http\Message\ResponseInterface; |
17 | 19 | use Psr\Http\Message\StreamInterface; |
18 | 20 |
|
19 | 21 | /** |
|
22 | 24 | */ |
23 | 25 | trait MessageResponseTrait |
24 | 26 | { |
25 | | - public function getProtocolVersion() |
| 27 | + public function getProtocolVersion(): string |
26 | 28 | { |
27 | 29 | return $this->response->getProtocolVersion(); |
28 | 30 | } |
29 | 31 |
|
30 | | - public function withProtocolVersion($version) |
| 32 | + public function withProtocolVersion($version): MessageInterface |
31 | 33 | { |
32 | 34 | return $this->response->withProtocolVersion($version); |
33 | 35 | } |
34 | 36 |
|
35 | | - public function getHeaders() |
| 37 | + public function getHeaders(): array |
36 | 38 | { |
37 | 39 | return $this->response->getHeaders(); |
38 | 40 | } |
39 | 41 |
|
40 | | - public function hasHeader($name) |
| 42 | + public function hasHeader(string $name): bool |
41 | 43 | { |
42 | 44 | return $this->response->hasHeader($name); |
43 | 45 | } |
44 | 46 |
|
45 | | - public function getHeader($name) |
| 47 | + public function getHeader(string $name): array |
46 | 48 | { |
47 | 49 | return $this->response->getHeader($name); |
48 | 50 | } |
49 | 51 |
|
50 | | - public function getHeaderLine($name) |
| 52 | + public function getHeaderLine(string $name): string |
51 | 53 | { |
52 | 54 | return $this->response->getHeaderLine($name); |
53 | 55 | } |
54 | 56 |
|
55 | | - public function withHeader($name, $value) |
| 57 | + public function withHeader(string $name, $value): MessageInterface |
56 | 58 | { |
57 | 59 | return $this->response->withHeader($name, $value); |
58 | 60 | } |
59 | 61 |
|
60 | | - public function withAddedHeader($name, $value) |
| 62 | + public function withAddedHeader(string $name, $value): MessageInterface |
61 | 63 | { |
62 | 64 | return $this->response->withAddedHeader($name, $value); |
63 | 65 | } |
64 | 66 |
|
65 | | - public function withoutHeader($name) |
| 67 | + public function withoutHeader(string $name): MessageInterface |
66 | 68 | { |
67 | 69 | return $this->response->withoutHeader($name); |
68 | 70 | } |
69 | 71 |
|
70 | | - public function getBody() |
| 72 | + public function getBody(): StreamInterface |
71 | 73 | { |
72 | 74 | return $this->response->getBody(); |
73 | 75 | } |
74 | 76 |
|
75 | | - public function withBody(StreamInterface $body) |
| 77 | + public function withBody(StreamInterface $body): MessageInterface |
76 | 78 | { |
77 | 79 | return $this->response->withBody($body); |
78 | 80 | } |
79 | 81 |
|
80 | | - public function getStatusCode() |
| 82 | + public function getStatusCode(): int |
81 | 83 | { |
82 | 84 | return $this->response->getStatusCode(); |
83 | 85 | } |
84 | 86 |
|
85 | | - public function withStatus($code, $reasonPhrase = '') |
| 87 | + public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface |
86 | 88 | { |
87 | 89 | return $this->response->withStatus($code, $reasonPhrase); |
88 | 90 | } |
89 | 91 |
|
90 | | - public function getReasonPhrase() |
| 92 | + public function getReasonPhrase(): string |
91 | 93 | { |
92 | 94 | return $this->response->getReasonPhrase(); |
93 | 95 | } |
|
0 commit comments