Completed
Push — master ( 85acdc...4f84c2 )
by Patrick
02:29
created

Message::withoutHeader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Mosaic\Http\Adapters\Psr7;
4
5
use Psr\Http\Message\MessageInterface;
6
use Psr\Http\Message\StreamInterface;
7
8
abstract class Message implements MessageInterface
9
{
10
    /**
11
     * @var MessageInterface
12
     */
13
    protected $wrapped;
14
15
    /**
16
     * Message constructor.
17
     * @param MessageInterface $wrapped
18
     */
19
    public function __construct(MessageInterface $wrapped)
20
    {
21
        $this->wrapped = $wrapped;
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function getProtocolVersion()
28
    {
29
        return $this->getWrapped()->getProtocolVersion();
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function withProtocolVersion($version)
36
    {
37
        return new static($this->getWrapped()->withProtocolVersion($version));
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getHeaders()
44
    {
45
        return $this->getWrapped()->getHeaders();
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function hasHeader($name)
52
    {
53
        return $this->getWrapped()->hasHeader($name);
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function getHeader($name)
60
    {
61
        return $this->getWrapped()->getHeader($name);
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function getHeaderLine($name)
68
    {
69
        return $this->getWrapped()->getHeaderLine($name);
70
    }
71
72
    /**
73
     * {@inheritdoc}
74
     */
75
    public function withHeader($name, $value)
76
    {
77
        return new static($this->getWrapped()->withHeader($name, $value));
78
    }
79
80
    /**
81
     * {@inheritdoc}
82
     */
83
    public function withAddedHeader($name, $value)
84
    {
85
        return new static($this->getWrapped()->withAddedHeader($name, $value));
86
    }
87
88
    /**
89
     * {@inheritdoc}
90
     */
91
    public function withoutHeader($name)
92
    {
93
        return new static($this->getWrapped()->withoutHeader($name));
94
    }
95
96
    /**
97
     * {@inheritdoc}
98
     */
99
    public function getBody()
100
    {
101
        return $this->getWrapped()->getBody();
102
    }
103
104
    /**
105
     * {@inheritdoc}
106
     */
107
    public function withBody(StreamInterface $body)
108
    {
109
        return new static($this->getWrapped()->withBody($body));
110
    }
111
112
    /**
113
     * @return mixed
114
     */
115
    abstract protected function getWrapped();
116
}
117