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

PathException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 5
dl 0
loc 11
rs 10
1
<?php
2
3
namespace Swaggest\JsonDiff;
4
5
6
use Throwable;
7
8
class PathException extends Exception
9
{
10
    /** @var object */
11
    private $operation;
12
13
    /** @var string */
14
    private $field;
15
16
    /**
17
     * @param string $message
18
     * @param object $operation
19
     * @param string $field
20
     * @param int $code
21
     * @param Throwable|null $previous
22
     */
23
    public function __construct(
24
        $message,
25
        $operation,
26
        $field,
27
        $code = 0,
28
        Throwable $previous = null
29
    )
30
    {
31
        parent::__construct($message, $code, $previous);
32
        $this->operation = $operation;
33
        $this->field = $field;
34
    }
35
36
    /**
37
     * @return object
38
     */
39
    public function getOperation()
40
    {
41
        return $this->operation;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getField()
48
    {
49
        return $this->field;
50
    }
51
}
52