JsonDecodeException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 4
Bugs 2 Features 0
Metric Value
eloc 5
c 4
b 2
f 0
dl 0
loc 25
rs 10
ccs 0
cts 8
cp 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getJson() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of Guzzle HTTP JSON-RPC
5
 *
6
 * Copyright (c) 2014 Nature Delivered Ltd. <http://graze.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @see  http://github.com/graze/guzzle-jsonrpc/blob/master/LICENSE
12
 * @link http://github.com/graze/guzzle-jsonrpc
13
 */
14
15
namespace Graze\GuzzleHttp\JsonRpc\Exception;
16
17
use Throwable;
18
19
class JsonDecodeException extends \InvalidArgumentException
20
{
21
    /**
22
     * @var string
23
     */
24
    private $json;
25
26
    /**
27
     * @param string        $message    The Exception message to throw
28
     * @param int           $code       The Exception code
29
     * @param Throwable     $previous   The previous throwable used for the exception chaining
30
     * @param string        $json       The JSON data.
31
     */
32
    public function __construct($message = "", $code = 0, Throwable $previous = null, $json = "")
33
    {
34
        parent::__construct($message, $code, $previous);
35
        $this->json = $json;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getJson()
42
    {
43
        return $this->json;
44
    }
45
}
46