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

IntrospectionResponse::generateHttpResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
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