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

IntrospectionResponse::setIntrospectionData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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