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

AbstractEntity::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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