Completed
Push — master ( c4e3cd...c5cae6 )
by Anton
05:38
created

EntityEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 23
wmc 2
lcom 0
cbo 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A entity() 0 4 1
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license   MIT
6
 * @author    Anton Titov (Wolfy-J)
7
 */
8
9
namespace Spiral\Models\Events;
10
11
use Spiral\Models\EntityInterface;
12
use Symfony\Component\EventDispatcher\Event;
13
14
/**
15
 * Entity specific event.
16
 */
17
class EntityEvent extends Event
18
{
19
    /**
20
     * @var null|EntityInterface
21
     */
22
    private $entity = null;
23
24
    /**
25
     * @param EntityInterface $entity
26
     */
27
    public function __construct(EntityInterface $entity)
28
    {
29
        $this->entity = $entity;
30
    }
31
32
    /**
33
     * @return null|EntityInterface
34
     */
35
    public function entity()
36
    {
37
        return $this->entity;
38
    }
39
}