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

MissingFieldException::getMissingField()   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
use Throwable;
6
7
class MissingFieldException extends Exception
8
{
9
    /** @var string */
10
    private $missingField;
11
    /** @var object */
12
    private $operation;
13
14
    /**
15
     * @param string $missingField
16
     * @param object $operation
17
     * @param int $code
18
     * @param Throwable|null $previous
19
     */
20
    public function __construct(
21
        $missingField,
22
        $operation,
23
        $code = 0,
24
        Throwable $previous = null
25
    )
26
    {
27
        parent::__construct('Missing "' . $missingField . '" in operation data', $code, $previous);
28
        $this->missingField = $missingField;
29
        $this->operation = $operation;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getMissingField()
36
    {
37
        return $this->missingField;
38
    }
39
40
    /**
41
     * @return object
42
     */
43
    public function getOperation()
44
    {
45
        return $this->operation;
46
    }
47
}
48