Video   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 96
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 15
c 1
b 0
f 1
dl 0
loc 96
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setProgress() 0 3 1
A getMime() 0 3 1
A getSize() 0 3 1
A setSize() 0 3 1
A getPath() 0 3 1
A setPath() 0 7 1
A getProgress() 0 3 1
A setMime() 0 3 1
1
<?php
2
3
namespace Iman\Streamer;
4
5
class Video
6
{
7
    /**
8
     * Video path.
9
     *
10
     * @var string
11
     */
12
    private $path;
13
14
    /**
15
     * Video MIME type.
16
     *
17
     * @var string
18
     */
19
    private $mime;
20
21
    /**
22
     * Video size.
23
     *
24
     * @var int
25
     */
26
    private $size;
27
28
    /**
29
     * Video progress.
30
     *
31
     * @var int
32
     */
33
    private $progress;
34
35
    /**
36
     * @return string
37
     */
38
    public function getPath(): string
39
    {
40
        return $this->path;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getMime(): string
47
    {
48
        return $this->mime;
49
    }
50
51
    /**
52
     * @return int
53
     */
54
    public function getSize(): int
55
    {
56
        return $this->size;
57
    }
58
59
    /**
60
     * @param  string  $path
61
     */
62
    public function setPath(string $path): void
63
    {
64
        $this->path = $path;
65
66
        $this->setMime(mime_content_type($path));
67
68
        $this->setSize(filesize($path));
69
    }
70
71
    /**
72
     * @param  string  $mime
73
     */
74
    private function setMime(string $mime): void
75
    {
76
        $this->mime = $mime;
77
    }
78
79
    /**
80
     * @param  int  $size
81
     */
82
    private function setSize(int $size): void
83
    {
84
        $this->size = $size;
85
    }
86
87
    /**
88
     * @return int
89
     */
90
    public function getProgress(): int
91
    {
92
        return $this->progress;
93
    }
94
95
    /**
96
     * @param  int  $progress
97
     */
98
    public function setProgress(int $progress): void
99
    {
100
        $this->progress = $progress;
101
    }
102
}
103