Completed
Push — master ( 45a366...9cb252 )
by Alexey
59:39 queued 19:37
created

InvalidJson   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 3
c 3
b 1
f 1
lcom 0
cbo 1
dl 0
loc 36
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getJson() 0 3 1
A setJson() 0 5 1
A __construct() 0 7 1
1
<?php
2
3
namespace PhMap\Exception;
4
5
use \PhMap\Exception;
6
7
/**
8
 * Class InvalidJson
9
 * @package PhMap\Exception
10
 */
11
class InvalidJson extends Exception {
12
13
    /**
14
     * @var string
15
     */
16
    private $json;
17
18
    /**
19
     * @return string
20
     */
21
    public function getJson() {
22
        return $this->json;
23
    }
24
25
    /**
26
     * @param string $json
27
     * @return $this
28
     */
29
    public function setJson($json) {
30
        $this->json = $json;
31
32
        return $this;
33
    }
34
35
    /**
36
     * @param string $json
37
     */
38
    public function __construct($json) {
39
        $this->setJson($json);
40
41
        $message = 'Json "' . $this->getJson() . '" is invalid';
42
43
        parent::__construct($message);
44
    }
45
46
}