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

VideoEncodedEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
cbo 1
dl 0
loc 53
ccs 8
cts 8
cp 1
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getVideoId() 0 4 1
A getEncodingIds() 0 4 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 when a video was successfully encoded.
19
 *
20
 * @author Christian Flothmann <[email protected]>
21
 *
22
 * @final since 1.5
23
 */
24
class VideoEncodedEvent extends Event
25
{
26
    /**
27
     * The VIDEO_ENCODED event occurs when a video was successfully encoded.
28
     *
29
     * The event listener method receives a Xabbuh\PandaBundle\Event\VideoCreatedEvent instance.
30
     */
31
    const NAME = 'xabbuh_panda.video_encoded';
32
33
    /**
34
     * The id of the encoded video
35
     * @var string
36
     */
37
    private $videoId;
38
39
    /**
40
     * List of encoding ids of this video
41
     * @var string[]
42
     */
43
    private $encodingIds = array();
44
45
    /**
46
     * Constructs a new VideoEncodedEvent.
47
     *
48
     * @param string   $videoId     Video id
49
     * @param string[] $encodingIds Ids of the video's encodings
50
     */
51 4
    public function __construct($videoId, array $encodingIds)
52
    {
53 4
        $this->videoId = $videoId;
54 4
        $this->encodingIds = $encodingIds;
55 4
    }
56
57
    /**
58
     * Returns the video id.
59
     *
60
     * @return string The video id
61
     */
62 3
    public function getVideoId()
63
    {
64 3
        return $this->videoId;
65
    }
66
67
    /**
68
     * Returns the video's encoding ids.
69
     *
70
     * @return string[] The encoding ids
71
     */
72 3
    public function getEncodingIds()
73
    {
74 3
        return $this->encodingIds;
75
    }
76
}
77