Completed
Pull Request — master (#869)
by
unknown
01:43
created

IntrospectionResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 62.5%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 35
ccs 5
cts 8
cp 0.625
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setIntrospectionData() 0 4 1
A getIntrospectionData() 0 4 1
A generateHttpResponse() 0 6 1
1
<?php
2
3
namespace League\OAuth2\Server\ResponseTypes;
4
5
use Psr\Http\Message\ResponseInterface;
6
7
class IntrospectionResponse extends AbstractResponseType
8
{
9
    /**
10
     * @var array
11
     */
12
    private $introspectionData;
13
14
    /**
15
     * @param array $introspectionData
16
     */
17 5
    public function setIntrospectionData(array $introspectionData)
18
    {
19 5
        $this->introspectionData = $introspectionData;
20 5
    }
21
22
    /**
23
     * @return array
24
     */
25 5
    public function getIntrospectionData()
26
    {
27 5
        return $this->introspectionData;
28
    }
29
30
    /**
31
     * @param ResponseInterface $response
32
     *
33
     * @return ResponseInterface
34
     */
35
    public function generateHttpResponse(ResponseInterface $response)
36
    {
37
        $response->getBody()->write(json_encode($this->introspectionData));
38
39
        return $response;
40
    }
41
}
42