Passed
Push — master ( 354d5b...4607a5 )
by Reyo
02:27
created

GetTask   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
eloc 10
c 1
b 0
f 0
dl 0
loc 40
ccs 0
cts 24
cp 0
rs 10
wmc 7
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 GetTask extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Jane\OpenApiRuntime\Client\Psr7Endpoint
13
{
14
    protected $id;
15
16
    public function __construct(int $id)
17
    {
18
        $this->id = $id;
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(['{id}'], [$this->id], '/v1/tasks/{id}');
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\Task|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\\Task', 'json');
52
        }
53
    }
54
}
55