Completed
Pull Request — master (#45)
by Maximilian
03:21
created

VideoItem::fromAmazonRequest()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 3
nc 4
nop 1
1
<?php
2
3
namespace MaxBeckers\AmazonAlexa\Response\Directives\VideoApp;
4
5
/**
6
 * @author Maximilian Beckers <[email protected]>
7
 */
8
class VideoItem
9
{
10
    /**
11
     * @var string|null
12
     */
13
    public $source;
14
15
    /**
16
     * @var Metadata|null
17
     */
18
    public $metadata;
19
20
    /**
21
     * @param string        $source
22
     * @param Metadata|null $metadata
23
     *
24
     * @return VideoItem
25
     */
26
    public static function create(string $source, Metadata $metadata = null): self
27
    {
28
        $videoItem = new self();
29
30
        $videoItem->source   = $source;
31
        $videoItem->metadata = $metadata;
32
33
        return $videoItem;
34
    }
35
}
36