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

ValidatorException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 35
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getField() 0 4 1
A getErrorMessage() 0 4 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