Passed
Push — master ( 2cb0be...da4b8b )
by Vitaliy
05:13 queued 02:54
created

BeforeDenormalizationEvent::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
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
declare(strict_types = 1);
4
5
/*
6
 * This file is part of the FiveLab Resource package
7
 *
8
 * (c) FiveLab
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code
12
 */
13
14
namespace FiveLab\Component\Resource\Serializer\Events;
15
16
use Symfony\Component\EventDispatcher\Event;
17
18
/**
19
 * Before denormalization event.
20
 *
21
 * @author Vitaliy Zhuk <[email protected]>
22
 */
23 View Code Duplication
class BeforeDenormalizationEvent extends Event
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated with message: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
24
{
25
    /**
26
     * @var mixed
27
     */
28
    private $data;
29
30
    /**
31
     * @var string
32
     */
33
    private $type;
34
35
    /**
36
     * @var string
37
     */
38
    private $format;
39
40
    /**
41
     * @var array
42
     */
43
    private $context;
44
45
    /**
46
     * Constructor.
47
     *
48
     * @param mixed  $data
49
     * @param string $type
50
     * @param string $format
51
     * @param array  $context
52
     */
53 5
    public function __construct($data, string $type, string $format, array $context)
54
    {
55 5
        $this->data = $data;
56 5
        $this->type = $type;
57 5
        $this->format = $format;
58 5
        $this->context = $context;
59 5
    }
60
61
    /**
62
     * Get data
63
     *
64
     * @return mixed
65
     */
66 1
    public function getData()
67
    {
68 1
        return $this->data;
69
    }
70
71
    /**
72
     * Get type
73
     *
74
     * @return string
75
     */
76 1
    public function getType(): string
77
    {
78 1
        return $this->type;
79
    }
80
81
    /**
82
     * Get format
83
     *
84
     * @return string
85
     */
86 1
    public function getFormat(): string
87
    {
88 1
        return $this->format;
89
    }
90
91
    /**
92
     * Get context
93
     *
94
     * @return array
95
     */
96 1
    public function getContext(): array
97
    {
98 1
        return $this->context;
99
    }
100
}
101