PostPersistEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 42
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A aggregate() 0 4 1
A eventStream() 0 4 1
1
<?php
2
/**
3
 * This file is part of the Cubiche package.
4
 *
5
 * Copyright (c) Cubiche
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Cubiche\Domain\EventSourcing\Event;
12
13
use Cubiche\Domain\EventPublisher\DomainEvent;
14
use Cubiche\Domain\EventSourcing\EventSourcedAggregateRootInterface;
15
use Cubiche\Domain\EventSourcing\EventStore\EventStream;
16
17
/**
18
 * PostPersistEvent class.
19
 *
20
 * @author Ivannis Suárez Jerez <[email protected]>
21
 */
22
class PostPersistEvent extends DomainEvent
23
{
24
    /**
25
     * @var EventSourcedAggregateRootInterface
26
     */
27
    protected $aggregate;
28
29
    /**
30
     * @var EventStream
31
     */
32
    protected $eventStream;
33
34
    /**
35
     * PostPersistEvent constructor.
36
     *
37
     * @param EventSourcedAggregateRootInterface $aggregate
38
     * @param EventStream                        $eventStream
39
     */
40
    public function __construct(EventSourcedAggregateRootInterface $aggregate, EventStream $eventStream)
41
    {
42
        parent::__construct();
43
44
        $this->aggregate = $aggregate;
45
        $this->eventStream = $eventStream;
46
    }
47
48
    /**
49
     * @return EventSourcedAggregateRootInterface
50
     */
51
    public function aggregate()
52
    {
53
        return $this->aggregate;
54
    }
55
56
    /**
57
     * @return EventStream
58
     */
59
    public function eventStream()
60
    {
61
        return $this->eventStream;
62
    }
63
}
64