UnresolvableConflict   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 1 Features 1
Metric Value
eloc 8
dl 0
loc 21
ccs 0
cts 8
cp 0
rs 10
c 3
b 1
f 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getConflictingEvents() 0 3 1
A getAggregateId() 0 3 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