Completed
Push — master ( cc32cc...49179a )
by Julián
01:24
created

AbstractEntity   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getIdentity() 0 4 1
1
<?php
2
3
/*
4
 * aggregate (https://github.com/phpgears/aggregate).
5
 * Aggregate base.
6
 *
7
 * @license MIT
8
 * @link https://github.com/phpgears/aggregate
9
 * @author Julián Gutiérrez <[email protected]>
10
 */
11
12
declare(strict_types=1);
13
14
namespace Gears\Aggregate;
15
16
use Gears\Identity\Identity;
17
18
/**
19
 * Abstract entity class.
20
 */
21
abstract class AbstractEntity implements Entity
22
{
23
    /**
24
     * @var Identity
25
     */
26
    protected $identity;
27
28
    /**
29
     * AbstractEntity constructor.
30
     *
31
     * @param Identity $identity
32
     */
33
    public function __construct(Identity $identity)
34
    {
35
        $this->identity = $identity;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    final public function getIdentity(): Identity
42
    {
43
        return $this->identity;
44
    }
45
}
46