Total Complexity | 7 |
Total Lines | 74 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | trait RequestDecorator |
||
12 | { |
||
13 | use MessageDecorator { |
||
14 | getMessage as getRequest; |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Exchanges the underlying request with another. |
||
19 | * |
||
20 | * @return self |
||
21 | */ |
||
22 | public function withRequest(RequestInterface $request) |
||
23 | { |
||
24 | 1 | $new = clone $this; |
|
25 | $new->message = $request; |
||
26 | 1 | ||
27 | 1 | return $new; |
|
28 | } |
||
29 | 1 | ||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function getRequestTarget() |
||
34 | { |
||
35 | 1 | return $this->message->getRequestTarget(); |
|
|
|||
36 | } |
||
37 | 1 | ||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | public function withRequestTarget($requestTarget) |
||
42 | { |
||
43 | 1 | $new = clone $this; |
|
44 | $new->message = $this->message->withRequestTarget($requestTarget); |
||
45 | 1 | ||
46 | 1 | return $new; |
|
47 | } |
||
48 | 1 | ||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function getMethod() |
||
55 | } |
||
56 | 1 | ||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | public function withMethod($method) |
||
61 | { |
||
62 | 1 | $new = clone $this; |
|
63 | $new->message = $this->message->withMethod($method); |
||
64 | 1 | ||
65 | 1 | return $new; |
|
66 | } |
||
67 | 1 | ||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | public function getUri() |
||
72 | { |
||
73 | 1 | return $this->message->getUri(); |
|
74 | } |
||
75 | 1 | ||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function withUri(UriInterface $uri, $preserveHost = false) |
||
85 | } |
||
86 | } |
||
87 |