Skip to content

Commit 3dcad36

Browse files
authored
Fix psalm errors (#45)
1 parent b064343 commit 3dcad36

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

src/DataResponse.php

+51
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,29 @@ public function getBody(): StreamInterface
5959
throw new RuntimeException('Data must be a string value.');
6060
}
6161

62+
/**
63+
* @param string $name
64+
*
65+
* @return array<array-key, string>
66+
*/
6267
public function getHeader($name): array
6368
{
6469
$this->response = $this->formatResponse();
6570
return $this->response->getHeader($name);
6671
}
6772

73+
/**
74+
* @param string $name
75+
*/
6876
public function getHeaderLine($name): string
6977
{
7078
$this->response = $this->formatResponse();
7179
return $this->response->getHeaderLine($name);
7280
}
7381

82+
/**
83+
* @return string[][]
84+
*/
7485
public function getHeaders(): array
7586
{
7687
$this->response = $this->formatResponse();
@@ -95,12 +106,21 @@ public function getStatusCode(): int
95106
return $this->response->getStatusCode();
96107
}
97108

109+
/**
110+
* @param string $name
111+
*/
98112
public function hasHeader($name): bool
99113
{
100114
$this->response = $this->formatResponse();
101115
return $this->response->hasHeader($name);
102116
}
103117

118+
/**
119+
* @param string $name
120+
* @param string|string[] $value
121+
*
122+
* @return static
123+
*/
104124
public function withAddedHeader($name, $value): self
105125
{
106126
$new = clone $this;
@@ -109,6 +129,9 @@ public function withAddedHeader($name, $value): self
109129
return $new;
110130
}
111131

132+
/**
133+
* @return static
134+
*/
112135
public function withBody(StreamInterface $body): self
113136
{
114137
$new = clone $this;
@@ -118,6 +141,12 @@ public function withBody(StreamInterface $body): self
118141
return $new;
119142
}
120143

144+
/**
145+
* @param string $name
146+
* @param string|string[] $value
147+
*
148+
* @return static
149+
*/
121150
public function withHeader($name, $value): self
122151
{
123152
$new = clone $this;
@@ -126,6 +155,11 @@ public function withHeader($name, $value): self
126155
return $new;
127156
}
128157

158+
/**
159+
* @param string $name
160+
*
161+
* @return static
162+
*/
129163
public function withoutHeader($name): self
130164
{
131165
$new = clone $this;
@@ -134,6 +168,11 @@ public function withoutHeader($name): self
134168
return $new;
135169
}
136170

171+
/**
172+
* @param string $version
173+
*
174+
* @return static
175+
*/
137176
public function withProtocolVersion($version): self
138177
{
139178
$new = clone $this;
@@ -142,6 +181,12 @@ public function withProtocolVersion($version): self
142181
return $new;
143182
}
144183

184+
/**
185+
* @param int $code
186+
* @param string $reasonPhrase
187+
*
188+
* @return static
189+
*/
145190
public function withStatus($code, $reasonPhrase = ''): self
146191
{
147192
$new = clone $this;
@@ -150,6 +195,9 @@ public function withStatus($code, $reasonPhrase = ''): self
150195
return $new;
151196
}
152197

198+
/**
199+
* @return static
200+
*/
153201
public function withResponseFormatter(DataResponseFormatterInterface $responseFormatter): self
154202
{
155203
$new = clone $this;
@@ -159,6 +207,9 @@ public function withResponseFormatter(DataResponseFormatterInterface $responseFo
159207
return $new;
160208
}
161209

210+
/**
211+
* @return static
212+
*/
162213
public function withData($data): self
163214
{
164215
$new = clone $this;

0 commit comments

Comments
 (0)