VideoTransformer::stringToVideo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the XabbuhPandaClient package.
5
 *
6
 * (c) Christian Flothmann <[email protected]>
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 Xabbuh\PandaClient\Transformer;
13
14
/**
15
 * Transformation from various data representation formats into Video models and
16
 * vice versa.
17
 *
18
 * A JSON object returned by the Panda api service may contain the following
19
 * properties:
20
 * <ul>
21
 *   <li>id</li>
22
 *   <li>created_at</li>
23
 *   <li>updated_at</li>
24
 *   <li>original_filename</li>
25
 *   <li>extname</li>
26
 *   <li>source_url</li>
27
 *   <li>duration</li>
28
 *   <li>width</li>
29
 *   <li>height</li>
30
 *   <li>file_size</li>
31
 *   <li>video_bitrate</li>
32
 *   <li>audio_bitrate</li>
33
 *   <li>video_codec</li>
34
 *   <li>audio_codec</li>
35
 *   <li>fps</li>
36
 *   <li>audio_channels</li>
37
 *   <li>audio_sample_rate</li>
38
 *   <li>status</li>
39
 *   <li>mime_type</li>
40
 *   <li>path</li>
41
 * </ul>
42
 *
43
 * @author Christian Flothmann <[email protected]>
44
 */
45
class VideoTransformer extends BaseTransformer implements VideoTransformerInterface
46
{
47
    /**
48
     * {@inheritDoc}
49
     */
50 1
    public function stringToVideo($jsonString)
51
    {
52 1
        return $this->serializer->deserialize($jsonString, 'Video');
53
    }
54
55
    /**
56
     * {@inheritDoc}
57
     */
58 1
    public function stringToVideoCollection($jsonString)
59
    {
60 1
        return $this->serializer->deserialize($jsonString, 'Video');
61
    }
62
}
63