Passed
Push — master ( 17481c...d9f781 )
by Reyo
02:57
created

src/Api/Endpoint/GetCustomersByRelationId.php (1 issue)

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\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\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\\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...i\Model\Customer[]|null.
Loading history...
52
        }
53
    }
54
}
55