InvalidValueException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 33
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getIdentifier() 0 4 1
1
<?php
2
/**
3
 * Particle.
4
 *
5
 * @link      http://github.com/particle-php for the canonical source repository
6
 * @copyright Copyright (c) 2005-2016 Particle (http://particle-php.com)
7
 * @license   https://github.com/particle-php/validator/blob/master/LICENSE New BSD License
8
 */
9
namespace Particle\Validator\Exception;
10
11
use Particle\Validator\ExceptionInterface;
12
13
/**
14
 * The invalid value exception is used by a callback to provide custom errors.
15
 *
16
 * @package Particle\Validator
17
 */
18
class InvalidValueException extends \Exception implements ExceptionInterface
19
{
20
    /**
21
     * @var string
22
     */
23
    protected $identifier;
24
25
    /**
26
     * @var string
27
     */
28
    protected $message;
29
30
    /**
31
     * @param string $message
32
     * @param string $identifier
33
     * @param \Exception $previous
34
     */
35 1
    public function __construct($message, $identifier, \Exception $previous = null)
36
    {
37 1
        $this->message = $message;
38 1
        $this->identifier = $identifier;
39
40 1
        parent::__construct($message, 0, $previous);
41 1
    }
42
43
    /**
44
     * @return string
45
     */
46 1
    public function getIdentifier()
47
    {
48 1
        return $this->identifier;
49
    }
50
}
51