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

UnresolvableConflict   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 25
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getStreamId() 0 4 1
A getConflictingEvents() 0 4 1
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