UnresolvableConflict::getConflictingEvents()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 1 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 2
b 1
f 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/event-sourcing 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
namespace Daikon\EventSourcing\EventStore;
10
11
use Daikon\EventSourcing\Aggregate\Event\DomainEventSequenceInterface;
12
use Daikon\EventSourcing\Aggregate\AggregateIdInterface;
13
use Daikon\Interop\RuntimeException;
14
15
final class UnresolvableConflict extends RuntimeException
16
{
17
    private AggregateIdInterface $aggregateId;
18
19
    private DomainEventSequenceInterface $conflictingEvents;
20
21
    public function __construct(AggregateIdInterface $aggregateId, DomainEventSequenceInterface $conflictingEvents)
22
    {
23
        $this->aggregateId = $aggregateId;
24
        $this->conflictingEvents = $conflictingEvents;
25
        parent::__construct('Unable to resolve conflict for stream '.$this->aggregateId);
26
    }
27
28
    public function getAggregateId(): AggregateIdInterface
29
    {
30
        return $this->aggregateId;
31
    }
32
33
    public function getConflictingEvents(): DomainEventSequenceInterface
34
    {
35
        return $this->conflictingEvents;
36
    }
37
}
38