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

ConcurrencyRaceLost::getStreamId()   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 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