Completed
Push — master ( 1e2cfa...28995d )
by Eric
04:38
created

AbstractEvent::getContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory Serializer package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\Serializer\Event;
13
14
use Ivory\Serializer\Context\ContextInterface;
15
use Ivory\Serializer\Mapping\TypeMetadataInterface;
16
use Symfony\Component\EventDispatcher\Event;
17
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21
abstract class AbstractEvent extends Event
22
{
23
    /**
24
     * @var mixed
25
     */
26
    protected $data;
27
28
    /**
29
     * @var TypeMetadataInterface
30
     */
31
    protected $type;
32
33
    /**
34
     * @var ContextInterface
35
     */
36
    private $context;
37
38
    /**
39
     * @param mixed                 $data
40
     * @param TypeMetadataInterface $type
41
     * @param ContextInterface      $context
42
     */
43 16
    public function __construct($data, TypeMetadataInterface $type, ContextInterface $context)
44
    {
45 16
        $this->data = $data;
46 16
        $this->type = $type;
47 16
        $this->context = $context;
48 16
    }
49
50
    /**
51
     * @return mixed
52
     */
53 16
    public function getData()
54
    {
55 16
        return $this->data;
56
    }
57
58
    /**
59
     * @return TypeMetadataInterface
60
     */
61 16
    public function getType()
62
    {
63 16
        return $this->type;
64
    }
65
66
    /**
67
     * @return ContextInterface
68
     */
69 16
    public function getContext()
70
    {
71 16
        return $this->context;
72
    }
73
}
74