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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 41
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getHeaders() 0 3 1
A __construct() 0 5 1
A getStatusCode() 0 3 1
A getResource() 0 3 1
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