ConcurrencyException::fromVersions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 3
cts 3
cp 1
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 1
1
<?php
2
3
namespace DDDominio\EventSourcing\EventStore;
4
5
class ConcurrencyException extends \Exception
6
{
7 5
    public static function fromVersions($currentVersion, $expectedVersion, $code = 0, \Exception $previous = null)
8
    {
9 5
        return new self(
10
            sprintf(
11 5
                'Current stream version %d does not match with the expected version %d',
12
                $currentVersion,
13
                $expectedVersion
14
            ),
15
            $code,
16
            $previous
17
        );
18
    }
19
}
20