AbstractResultException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 43
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getTask() 0 4 1
A getChecker() 0 4 1
A getJson() 0 4 1
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