EncodingProgressEvent::getProgress()   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 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the XabbuhPandaBundle 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\PandaBundle\Event;
13
14
use Symfony\Contracts\EventDispatcher\Event;
15
16
/**
17
 * Event that is triggered repeatedly while an encoding process is running.
18
 *
19
 * @author Christian Flothmann <[email protected]>
20
 */
21
final class EncodingProgressEvent extends Event
22
{
23
    /**
24
     * The ENCODING_PROGRESS event occurs repeatedly while an encoding process is running.
25
     *
26
     * The event listener method receives a Xabbuh\PandaBundle\Event\EncodingProgressEvent instance.
27
     */
28
    const NAME = 'xabbuh_panda.encoding_progress';
29
30
    /**
31
     * The id of the encoded video
32
     * @var string
33
     */
34
    private $videoId;
35
36
    /**
37
     * The id of the encoding
38
     * @var string
39
     */
40
    private $encodingId;
41
42
    /**
43
     * The encoding progress
44
     * @var int
45
     */
46
    private $progress;
47
48
    /**
49
     * Constructs a new EncodingProgressEvent.
50
     *
51
     * @param string $videoId    Video id
52
     * @param string $encodingId Encoding id
53
     * @param int    $progress   Progress of the encoding
54
     */
55 4
    public function __construct($videoId, $encodingId, $progress)
56
    {
57 4
        $this->videoId = $videoId;
58 4
        $this->encodingId = $encodingId;
59 4
        $this->progress = $progress;
60 4
    }
61
62
    /**
63
     * Returns the video id.
64
     *
65
     * @return string The video id
66
     */
67 3
    public function getVideoId()
68
    {
69 3
        return $this->videoId;
70
    }
71
72
    /**
73
     * Returns the encoding id.
74
     *
75
     * @return string The encoding id
76
     */
77 3
    public function getEncodingId()
78
    {
79 3
        return $this->encodingId;
80
    }
81
82
    /**
83
     * Returns the encoding progress.
84
     *
85
     * @return int The progress
86
     */
87 3
    public function getProgress()
88
    {
89 3
        return $this->progress;
90
    }
91
}
92