Completed
Pull Request — 5.6 (#2830)
by Jeroen
14:14
created

DeepCloneAndSaveEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 62
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setClonedEntity() 0 6 1
A getClonedEntity() 0 4 1
A setEntity() 0 6 1
A getEntity() 0 4 1
1
<?php
2
3
namespace Kunstmaan\AdminBundle\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
7
/**
8
 * This event wil be used to pass metadata when the deep clone event is triggered.
9
 */
10
class DeepCloneAndSaveEvent 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...
11
{
12
    /**
13
     * @var mixed
14
     */
15
    private $entity;
16
17
    /**
18
     * @var mixed
19
     */
20
    private $clonedEntity;
21
22
    /**
23
     * @param mixed $entity       The origin entity
24
     * @param mixed $clonedEntity The cloned entity
25
     */
26 3
    public function __construct($entity, $clonedEntity)
27
    {
28 3
        $this->entity = $entity;
29 3
        $this->clonedEntity = $clonedEntity;
30 3
    }
31
32
    /**
33
     * @param mixed $clonedEntity
34
     *
35
     * @return DeepCloneAndSaveEvent
36
     */
37 1
    public function setClonedEntity($clonedEntity)
38
    {
39 1
        $this->clonedEntity = $clonedEntity;
40
41 1
        return $this;
42
    }
43
44
    /**
45
     * @return mixed
46
     */
47 3
    public function getClonedEntity()
48
    {
49 3
        return $this->clonedEntity;
50
    }
51
52
    /**
53
     * @param mixed $entity
54
     *
55
     * @return DeepCloneAndSaveEvent
56
     */
57 1
    public function setEntity($entity)
58
    {
59 1
        $this->entity = $entity;
60
61 1
        return $this;
62
    }
63
64
    /**
65
     * @return mixed
66
     */
67 3
    public function getEntity()
68
    {
69 3
        return $this->entity;
70
    }
71
}
72