ValidatorException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getField() 0 4 1
A getErrorMessage() 0 4 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of indragunawan/rest-service package.
5
 *
6
 * (c) Indra Gunawan <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace IndraGunawan\RestService\Exception;
13
14
class ValidatorException extends \RuntimeException
15
{
16
    /**
17
     * @var string
18
     */
19
    private $field;
20
21
    /**
22
     * @var string
23
     */
24
    private $errorMessage;
25
26
    /**
27
     * @param string          $field
28
     * @param string          $errorMessage
29
     * @param \Exception|null $prev
30
     */
31 2
    public function __construct($field, $errorMessage, \Exception $prev = null)
32
    {
33 2
        $this->field = $field;
34 2
        $this->errorMessage = $errorMessage;
35
36 2
        parent::__construct($field.' : '.$errorMessage, 0, $prev);
37 2
    }
38
39 1
    public function getField()
40
    {
41 1
        return $this->field;
42
    }
43
44 1
    public function getErrorMessage()
45
    {
46 1
        return $this->errorMessage;
47
    }
48
}
49