Passed
Pull Request — master (#55)
by
unknown
08:16
created

InvalidOperationException::getInvalidOperation()   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 InvalidOperationException extends Exception
9
{
10
    private object $operationObject;
11
12
    public function __construct(
13
        object    $operationObject,
14
        string    $message = '',
15
        int       $code = 0,
16
        Throwable $previous = null
17
    )
18
    {
19
        parent::__construct($message, $code, $previous);
20
        $this->operationObject = $operationObject;
21
    }
22
23
    public function getInvalidOperation(): string
24
    {
25
        return $this->operationObject->op;
26
    }
27
28
    public function getOperationObject(): object
29
    {
30
        return $this->operationObject;
31
    }
32
}
33