• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

contributte / psr7-http-message / 6679077911

28 Oct 2023 08:30PM UTC coverage: 87.908% (-9.1%) from 96.97%
6679077911

Pull #37

github

web-flow
Merge b7f30763a into 58a394ad1
Pull Request #37: Drop support PHP 8.0, use Contributte\QA and Contributte\Tester, add type hints

46 of 46 new or added lines in 11 files covered. (100.0%)

269 of 306 relevant lines covered (87.91%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

46.38
/src/ProxyRequest.php
1
<?php declare(strict_types = 1);
2

3
namespace Contributte\Psr7;
4

5
use Contributte\Psr7\Extra\ExtraServerRequestTrait;
6
use Psr\Http\Message\ServerRequestInterface;
7
use Psr\Http\Message\StreamInterface;
8
use Psr\Http\Message\UploadedFileInterface;
9
use Psr\Http\Message\UriInterface;
10

11
/**
12
 * Tiny wrapper for PSR-7 ServerRequestInterface
13
 */
14
class ProxyRequest implements ServerRequestInterface
15
{
16

17
        use ExtraServerRequestTrait;
18

19
        public function __construct(
1✔
20
                protected ServerRequestInterface $inner,
21
        )
22
        {
23
        }
1✔
24

25
        public function getOriginalRequest(): ServerRequestInterface
26
        {
27
                return $this->inner;
1✔
28
        }
29

30
        public function getProtocolVersion(): string
31
        {
32
                return $this->inner->getProtocolVersion();
1✔
33
        }
34

35
        public function withProtocolVersion(string $version): static
1✔
36
        {
37
                $new = clone $this;
1✔
38
                $new->inner = $this->inner->withProtocolVersion($version);
1✔
39

40
                return $new;
1✔
41
        }
42

43
        /**
44
         * @return string[][]
45
         */
46
        public function getHeaders(): array
47
        {
48
                return $this->inner->getHeaders();
1✔
49
        }
50

51
        public function hasHeader(string $name): bool
1✔
52
        {
53
                return $this->inner->hasHeader($name);
1✔
54
        }
55

56
        /**
57
         * @return string[]
58
         */
59
        public function getHeader(string $name): array
1✔
60
        {
61
                return $this->inner->getHeader($name);
1✔
62
        }
63

64
        public function getHeaderLine(string $name): string
1✔
65
        {
66
                return $this->inner->getHeaderLine($name);
1✔
67
        }
68

69
        /**
70
         * @param string|string[] $value
71
         */
72
        public function withHeader(string $name, $value): static
1✔
73
        {
74
                $new = clone $this;
1✔
75
                $new->inner = $this->inner->withHeader($name, $value);
1✔
76

77
                return $new;
1✔
78
        }
79

80
        /**
81
         * @param string|string[] $value
82
         */
83
        public function withAddedHeader(string $name, $value): static
1✔
84
        {
85
                $new = clone $this;
1✔
86
                $new->inner = $this->inner->withAddedHeader($name, $value);
1✔
87

88
                return $new;
1✔
89
        }
90

91
        public function withoutHeader(string $name): static
1✔
92
        {
93
                $new = clone $this;
1✔
94
                $new->inner = $this->inner->withoutHeader($name);
1✔
95

96
                return $new;
1✔
97
        }
98

99
        public function getBody(): StreamInterface
100
        {
101
                return $this->inner->getBody();
1✔
102
        }
103

104
        public function withBody(StreamInterface $body): static
1✔
105
        {
106
                $new = clone $this;
1✔
107
                $new->inner = $this->inner->withBody($body);
1✔
108

109
                return $new;
1✔
110
        }
111

112
        public function getRequestTarget(): string
113
        {
114
                return $this->inner->getRequestTarget();
×
115
        }
116

117
        public function withRequestTarget(string $requestTarget): static
118
        {
119
                $new = clone $this;
×
120
                $new->inner = $this->inner->withRequestTarget($requestTarget);
×
121

122
                return $new;
×
123
        }
124

125
        public function getMethod(): string
126
        {
127
                return $this->inner->getMethod();
×
128
        }
129

130
        public function withMethod(string $method): static
131
        {
132
                $new = clone $this;
×
133
                $new->inner = $this->inner->withMethod($method);
×
134

135
                return $new;
×
136
        }
137

138
        public function getUri(): UriInterface
139
        {
140
                return $this->inner->getUri();
×
141
        }
142

143
        public function withUri(UriInterface $uri, bool $preserveHost = false): static
144
        {
145
                $new = clone $this;
×
146
                $new->inner = $this->inner->withUri($uri, $preserveHost);
×
147

148
                return $new;
×
149
        }
150

151
        /**
152
         * @return mixed[]
153
         */
154
        public function getServerParams(): array
155
        {
156
                return $this->inner->getServerParams();
×
157
        }
158

159
        /**
160
         * @return mixed[]
161
         */
162
        public function getCookieParams(): array
163
        {
164
                return $this->inner->getCookieParams();
×
165
        }
166

167
        /**
168
         * @param mixed[] $cookies
169
         */
170
        public function withCookieParams(array $cookies): static
171
        {
172
                $new = clone $this;
×
173
                $new->inner = $this->inner->withCookieParams($cookies);
×
174

175
                return $new;
×
176
        }
177

178
        /**
179
         * @return mixed[]
180
         */
181
        public function getQueryParams(): array
182
        {
183
                return $this->inner->getQueryParams();
×
184
        }
185

186
        /**
187
         * @param mixed[] $query
188
         */
189
        public function withQueryParams(array $query): static
190
        {
191
                $new = clone $this;
×
192
                $new->inner = $this->inner->withQueryParams($query);
×
193

194
                return $new;
×
195
        }
196

197
        /**
198
         * @return UploadedFileInterface[]
199
         */
200
        public function getUploadedFiles(): array
201
        {
202
                return $this->inner->getUploadedFiles();
×
203
        }
204

205
        /**
206
         * @param UploadedFileInterface[]|mixed[] $uploadedFiles
207
         */
208
        public function withUploadedFiles(array $uploadedFiles): static
209
        {
210
                $new = clone $this;
×
211
                $new->inner = $this->inner->withUploadedFiles($uploadedFiles);
×
212

213
                return $new;
×
214
        }
215

216
        /**
217
         * @return mixed[]|object|null
218
         */
219
        public function getParsedBody()
220
        {
221
                return $this->inner->getParsedBody();
×
222
        }
223

224
        /**
225
         * @param mixed[]|object|null $data
226
         */
227
        public function withParsedBody($data): static
228
        {
229
                $new = clone $this;
×
230
                $new->inner = $this->inner->withParsedBody($data);
×
231

232
                return $new;
×
233
        }
234

235
        /**
236
         * @return mixed[]
237
         */
238
        public function getAttributes(): array
239
        {
240
                return $this->inner->getAttributes();
×
241
        }
242

243
        /**
244
         * @see getAttributes()
245
         * @param mixed  $default
246
         * @return mixed
247
         */
248
        public function getAttribute(string $name, $default = null)
249
        {
250
                return $this->inner->getAttribute($name, $default);
×
251
        }
252

253
        /**
254
         * @see getAttributes()
255
         * @param mixed  $value
256
         */
257
        public function withAttribute(string $name, $value): static
258
        {
259
                $new = clone $this;
×
260
                $new->inner = $this->inner->withAttribute($name, $value);
×
261

262
                return $new;
×
263
        }
264

265
        /**
266
         * @see getAttributes()
267
         */
268
        public function withoutAttribute(string $name): static
269
        {
270
                $new = clone $this;
×
271
                $new->inner = $this->inner->withoutAttribute($name);
×
272

273
                return $new;
×
274
        }
275

276
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc