GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#1)
by Pascal
02:13
created

ResourceResponse::getResource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Saikootau\ApiBundle\Http;
6
7
use Symfony\Component\HttpFoundation\Response;
8
9
class ResourceResponse
10
{
11
    private $resource;
12
    private $statusCode;
13
    private $headers;
14
15 4
    public function __construct(object $resource, int $statusCode = Response::HTTP_OK, array $headers = [])
16
    {
17 4
        $this->resource = $resource;
18 4
        $this->statusCode = $statusCode;
19 4
        $this->headers = $headers;
20 4
    }
21
22
    /**
23
     * Returns the resource to be send in the response.
24
     *
25
     * @return object
26
     */
27 2
    public function getResource(): object
28
    {
29 2
        return $this->resource;
30
    }
31
32
    /**
33
     * Returns the status code to be returned for the request given.
34
     *
35
     * @return int
36
     */
37 3
    public function getStatusCode(): int
38
    {
39 3
        return $this->statusCode;
40
    }
41
42
    /**
43
     * Returns any additional headers to be send for the request.
44
     *
45
     * @return array
46
     */
47 3
    public function getHeaders(): array
48
    {
49 3
        return $this->headers;
50
    }
51
}
52