GetVideoRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
dl 0
loc 42
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A serializeRequest() 0 2 1
A getSubstituables() 0 4 1
A getResourcePath() 0 2 1
A deserializeResponse() 0 2 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