getActualVersion()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace Governor\Framework\Repository;
10
11
/**
12
 * Description of ConflictingAggregateVersionException
13
 *
14
 * @author david
15
 */
16
class ConflictingAggregateVersionException extends \RuntimeException
17
{
18
19
    private $aggregateIdentifier;
20
    private $expectedVersion;
21
    private $actualVersion;
22
23 3
    public function __construct($id, $expectedVersion, $actualVersion)
24
    {
25 3
        parent::__construct(sprintf("The version of aggregate [%s] was not as expected. "
26 3
                . "Expected [%s], but repository found [%s]", $id,
27 3
                $expectedVersion, $actualVersion));
28 3
        $this->aggregateIdentifier = $id;
29 3
        $this->expectedVersion = $expectedVersion;
30 3
        $this->actualVersion = $actualVersion;
31 3
    }
32
33 2
    public function getAggregateIdentifier()
34
    {
35 2
        return $this->aggregateIdentifier;
36
    }
37
38 3
    public function getExpectedVersion()
39
    {
40 3
        return $this->expectedVersion;
41
    }
42
43 3
    public function getActualVersion()
44
    {
45 3
        return $this->actualVersion;
46
    }
47
48
49
}
50