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

GetCustomersByRelationId::getUri()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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 GetCustomersByRelationId extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint
13
{
14
    protected $relationId;
15
16
    public function __construct(string $relationId)
17
    {
18
        $this->relationId = $relationId;
19
    }
20
21
    use \Jane\OpenApiRuntime\Client\Psr7EndpointTrait;
22
23
    public function getMethod(): string
24
    {
25
        return 'GET';
26
    }
27
28
    public function getUri(): string
29
    {
30
        return str_replace(['{relationId}'], [$this->relationId], '/v1/customers/relationid/{relationId}');
31
    }
32
33
    public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array
34
    {
35
        return [[], null];
36
    }
37
38
    public function getExtraHeaders(): array
39
    {
40
        return ['Accept' => ['application/json']];
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     *
46
     * @return \ConnectHolland\TimechimpBundle\Api\Client\Model\Customer[]|null
47
     */
48
    protected function transformResponseBody(string $body, int $status, \Symfony\Component\Serializer\SerializerInterface $serializer, ?string $contentType)
49
    {
50
        if (200 === $status) {
51
            return $serializer->deserialize($body, 'ConnectHolland\\TimechimpBundle\\Api\\Client\\Model\\Customer[]', 'json');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $serializer->dese...el\Customer[]', 'json') also could return the type object which is incompatible with the documented return type ConnectHolland\Timechimp...t\Model\Customer[]|null.
Loading history...
52
        }
53
    }
54
}
55