Passed
Push — master ( cf05b0...ebef44 )
by Gaetano
06:06
created

PayloadBearer::getContentType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace PhpXmlRpc\Traits;
4
5
trait PayloadBearer
6
{
7
    /** @var string */
8
    public $payload;
9
    /** @var string */
10
    public $content_type = 'text/xml';
11
12
    /**
13
     * @internal
14
     *
15
     * @param string $payload
16
     * @param string $contentType
17
     * @return $this
18
     */
19
    public function setPayload($payload, $contentType = '')
20
    {
21
        $this->payload = $payload;
22
23
        if ($contentType != '') {
24
            $this->content_type = $contentType;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getPayload()
34
    {
35
        return $this->payload;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getContentType()
42
    {
43
        return $this->content_type;
44
    }
45
}
46