Completed
Push — master ( 2bc6aa...f63f47 )
by Indra
04:48
created

ValidatorException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
crap 1
1
<?php
2
3
namespace IndraGunawan\RestService\Exception;
4
5
class ValidatorException extends \RuntimeException
6
{
7
    /**
8
     * @var string
9
     */
10
    private $field;
11
12
    /**
13
     * @var string
14
     */
15
    private $errorMessage;
16
17
    /**
18
     * @param string          $field
19
     * @param string          $errorMessage
20
     * @param \Exception|null $prev
21
     */
22 2
    public function __construct($field, $errorMessage, \Exception $prev = null)
23
    {
24 2
        $this->field = $field;
25 2
        $this->errorMessage = $errorMessage;
26
27 2
        parent::__construct($field.' : '.$errorMessage, 0, $prev);
28 2
    }
29
30 1
    public function getField()
31
    {
32 1
        return $this->field;
33
    }
34
35 1
    public function getErrorMessage()
36
    {
37 1
        return $this->errorMessage;
38
    }
39
}
40