Passed
Push — master ( 7f7df8...6d2aba )
by Thorsten
01:53
created

UnresolvableConflict::getConflictingEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * This file is part of the daikon-cqrs/cqrs project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
declare(strict_types=1);
10
11
namespace Daikon\EventSourcing\EventStore;
12
13
use Exception;
14
15
final class UnresolvableConflict extends Exception
16
{
17
    /** @var StreamId */
18
    private $streamId;
19
20
    /** @var array */
21
    private $conflictingEvents;
22
23
    public function __construct(StreamId $streamId, array $conflictingEvents)
24
    {
25
        $this->streamId = $streamId;
26
        $this->conflictingEvents = $conflictingEvents;
27
        parent::__construct('Unable to resolve conflict for stream: '.$this->streamId);
28
    }
29
30
    public function getStreamId(): StreamId
31
    {
32
        return $this->streamId;
33
    }
34
35
    public function getConflictingEvents(): array
36
    {
37
        return $this->conflictingEvents;
38
    }
39
}
40