DuplicateError   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 49
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1
ccs 12
cts 12
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getTable() 0 4 1
A getIndex() 0 4 1
A getData() 0 4 1
1
<?php
2
/**
3
 * Created by gerk on 30.10.17 06:25
4
 */
5
6
namespace PeekAndPoke\Component\Slumber\Data\Error;
7
8
/**
9
 *
10
 *
11
 * @author Karsten J. Gerber <[email protected]>
12
 */
13
class DuplicateError extends StorageError
14
{
15
    /** @var string */
16
    private $table;
17
    /** @var string */
18
    private $index;
19
    /** @var string */
20
    private $data;
21
22
    /**
23
     * @param string          $message
24
     * @param string          $table
25
     * @param string          $index
26
     * @param string          $data
27
     * @param \Exception|null $previous
28
     */
29 2
    final public function __construct($message = '', $table, $index, $data, \Exception $previous = null)
30
    {
31 2
        parent::__construct($message, self::DUPLICATE_KEY, $previous);
32
33 2
        $this->table = $table;
34 2
        $this->index = $index;
35 2
        $this->data  = $data;
36 2
    }
37
38
    /**
39
     * @return string
40
     */
41 2
    public function getTable()
42
    {
43 2
        return $this->table;
44
    }
45
46
    /**
47
     * @return string
48
     */
49 2
    public function getIndex()
50
    {
51 2
        return $this->index;
52
    }
53
54
    /**
55
     * @return string
56
     */
57 2
    public function getData()
58
    {
59 2
        return $this->data;
60
    }
61
}
62