AbstractResultException::getJson()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Simplario\Checker\ResultException;
4
5
/**
6
 * Class AbstractResultException
7
 *
8
 * @package Simplario\Checker\ResultException
9
 */
10
abstract class AbstractResultException extends \Exception
11 24
{
12
    /**
13 24
     * @var array
14 24
     */
15 24
    protected $task;
16
17 1
    /**
18
     * AbstractResultException constructor.
19 1
     *
20
     * @param string $msg
21
     * @param array  $task
22 2
     */
23
    public function __construct($msg, array $task)
24 2
    {
25
        $this->message = $msg;
26
        $this->task = $task;
27 2
    }
28
29 2
    /**
30
     * @return array
31
     */
32
    public function getTask()
33
    {
34
        return $this->task;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getChecker()
41
    {
42
        return $this->task['checker'];
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getJson()
49
    {
50
        return json_encode($this->task);
51
    }
52
}
53