Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
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() |
||
44 | } |
||
45 | } |
||
46 |