DuplicateError::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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