Completed
Push — master ( ba82d8...306a50 )
by Daniel
03:11
created

Projector::emittedEventsByStream()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace DDDominio\EventSourcing\EventStore\Projection;
4
5
use DDDominio\EventSourcing\Common\DomainEvent;
6
7
class Projector
8
{
9
    /**
10
     * @var array
11
     */
12
    private $emittedEventsByStream = [];
13
14
    /**
15
     * @param string $stream
16
     * @param mixed $event
17
     */
18 5
    public function emit($stream, $event)
19
    {
20 5
        $this->emittedEventsByStream[$stream][] = DomainEvent::record($event);
21 5
    }
22
23
    /**
24
     * @return array
25
     */
26 10
    public function emittedEventsByStream()
27
    {
28 10
        return $this->emittedEventsByStream;
29
    }
30
}
31