GetVideoRequest::deserializeResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the pexels-library package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Pexels\Request;
13
14
use WBW\Library\Pexels\Response\AbstractResponse;
15
use WBW\Library\Pexels\Serializer\ResponseDeserializer;
16
use WBW\Library\Provider\Api\SubstituableRequestInterface;
17
use WBW\Library\Traits\Integers\IntegerIdTrait;
18
19
/**
20
 * Get video request.
21
 *
22
 * @author webeweb <https://github.com/webeweb>
23
 * @package WBW\Library\Pexels\Request
24
 */
25
class GetVideoRequest extends AbstractRequest implements SubstituableRequestInterface {
26
27
    use IntegerIdTrait {
28
        setId as public;
29
    }
30
31
    /**
32
     * Get video resource path.
33
     *
34
     * @var string
35
     */
36
    const GET_VIDEO_RESOURCE_PATH = "/v1/videos/videos/:id";
37
38
    /**
39
     * {@inheritDoc}
40
     */
41
    public function deserializeResponse(string $rawResponse): AbstractResponse {
42
        return ResponseDeserializer::deserializeVideoResponse($rawResponse);
43
    }
44
45
    /**
46
     * {@inheritDoc}
47
     */
48
    public function getResourcePath(): string {
49
        return self::GET_VIDEO_RESOURCE_PATH;
50
    }
51
52
    /**
53
     * {@inheritDoc}
54
     */
55
    public function getSubstituables(): array {
56
57
        return [
58
            ":id" => $this->getId(),
59
        ];
60
    }
61
62
    /**
63
     * {@inheritDoc}
64
     */
65
    public function serializeRequest(): array {
66
        return [];
67
    }
68
}
69