Passed
Push — master ( ccfc71...4eb344 )
by Viacheslav
15:41 queued 05:46
created

PatchTestOperationFailedException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 40
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A getOperation() 0 3 1
A getActualValue() 0 3 1
1
<?php
2
3
namespace Swaggest\JsonDiff;
4
5
6
use Throwable;
7
8
class PatchTestOperationFailedException extends Exception
9
{
10
    /** @var object */
11
    private $operation;
12
    /** @var string */
13
    private $actualValue;
14
15
    /**
16
     * @param object $operation
17
     * @param string $actualValue
18
     * @param int $code
19
     * @param Throwable|null $previous
20
     */
21
    public function __construct(
22
        $operation,
23
        $actualValue,
24
        $code = 0,
25
        Throwable $previous = null
26
    )
27
    {
28
        parent::__construct('Test operation ' . json_encode($operation, JSON_UNESCAPED_SLASHES)
29
            . ' failed: ' . json_encode($actualValue), $code, $previous);
30
        $this->operation = $operation;
31
        $this->actualValue = $actualValue;
32
    }
33
34
    /**
35
     * @return object
36
     */
37
    public function getOperation()
38
    {
39
        return $this->operation;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getActualValue()
46
    {
47
        return $this->actualValue;
48
    }
49
}
50