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

GetCustomersByRelationId   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
eloc 10
c 1
b 0
f 0
dl 0
loc 40
ccs 0
cts 24
cp 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A transformResponseBody() 0 4 2
A getUri() 0 3 1
A getMethod() 0 3 1
A getExtraHeaders() 0 3 1
A __construct() 0 3 1
A getBody() 0 3 1
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