Passed
Push — master ( 248c35...f550ad )
by Reyo
04:07
created

GetProjects::transformResponseBody()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 2
nc 2
nop 4
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the timechimp bundle package.
7
 * (c) Connect Holland.
8
 */
9
10
namespace ConnectHolland\TimechimpBundle\Api\Client\Endpoint;
11
12
class GetProjects extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint
13
{
14
    use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait;
15
16
    public function getMethod(): string
17
    {
18
        return 'GET';
19
    }
20
21
    public function getUri(): string
22
    {
23
        return '/v1/projects';
24
    }
25
26
    public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
27
    {
28
        return [[], null];
29
    }
30
31
    public function getExtraHeaders(): array
32
    {
33
        return ['Accept' => ['application/json']];
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     *
39
     * @return \ConnectHolland\TimechimpBundle\Api\Client\Model\Project[]|null
40
     */
41
    protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType)
42
    {
43
        if (200 === $status) {
44
            return $serializer->deserialize($body, 'ConnectHolland\\TimechimpBundle\\Api\\Client\\Model\\Project[]', 'json');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $serializer->dese...del\Project[]', 'json') also could return the type object which is incompatible with the documented return type ConnectHolland\Timechimp...nt\Model\Project[]|null.
Loading history...
45
        }
46
    }
47
}
48