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

ConcurrencyRaceLost   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 getLostEvents() 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 Daikon\EventSourcing\Aggregate\DomainEventInterface;
14
use Daikon\EventSourcing\Aggregate\DomainEventSequence;
15
use Exception;
16
17
final class ConcurrencyRaceLost extends Exception
18
{
19
    /** @var StreamId */
20
    private $streamId;
21
22
    /** @var  DomainEventInterface */
23
    private $lostEvents;
24
25
    public function __construct(StreamId $streamId, DomainEventSequence $lostEvents)
26
    {
27
        $this->streamId = $streamId;
28
        $this->lostEvents = $lostEvents;
0 ignored issues
show
Documentation Bug introduced by
It seems like $lostEvents of type object<Daikon\EventSourc...te\DomainEventSequence> is incompatible with the declared type object<Daikon\EventSourc...e\DomainEventInterface> of property $lostEvents.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
29
        parent::__construct('Unable to catchup on stream: '.$this->streamId);
30
    }
31
32
    public function getStreamId(): StreamId
33
    {
34
        return $this->streamId;
35
    }
36
37
    public function getLostEvents(): DomainEventSequence
38
    {
39
        return $this->lostEvents;
40
    }
41
}
42