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

PatchTestOperationFailedException::getOperation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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