ConcurrencyException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 15
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromVersions() 0 12 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