Completed
Push — symfony-5 ( fa4e1a...5166f9 )
by Christian
03:40
created

EncodingProgressEvent::getEncodingId()   A

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