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

IntrospectionResponse   A

Complexity

Total Complexity 3

Size/Duplication

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