TextResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getHeaders() 0 3 1
A response() 0 3 1
1
<?php
2
3
namespace Codeat3\FoaasClient\Response;
4
5
use Codeat3\FoaasClient\ResponseFilters\FoaasFilter;
6
7
class TextResponse implements FoaasResponse
8
{
9
    /**
10
     * A header string for the request.
11
     *
12
     * @var string
13
     */
14
    protected $acceptHeader = 'text/plain';
15
16
    /**
17
     * Returns the header type.
18
     *
19
     * @return string
20
     */
21
    public function getHeaders(): string
22
    {
23
        return $this->acceptHeader;
24
    }
25
26
    /**
27
     * Returns a response.
28
     *
29
     * @param string $response
30
     *
31
     * @return string
32
     */
33
    public function response(string $response, FoaasFilter $filter)
34
    {
35
        return $filter->filter($response);
36
    }
37
}
38